Skip to main content

nil_payload/request/cheat/
military.rs

1// Copyright (C) Call of Nil contributors
2// SPDX-License-Identifier: AGPL-3.0-only
3
4use bon::Builder;
5use nil_core::continent::coord::Coord;
6use nil_core::military::army::personnel::ArmyPersonnel;
7use nil_core::ruler::Ruler;
8use nil_core::world::config::WorldId;
9use serde::{Deserialize, Serialize};
10
11#[derive(Builder, Clone, Debug, Deserialize, Serialize)]
12#[serde(rename_all = "camelCase")]
13#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
14#[cfg_attr(feature = "typescript", ts(export))]
15pub struct CheatGetIdleArmiesAtRequest {
16  #[builder(start_fn, into)]
17  pub world: WorldId,
18  #[builder(into)]
19  pub coord: Coord,
20}
21
22#[derive(Builder, Clone, Debug, Deserialize, Serialize)]
23#[serde(rename_all = "camelCase")]
24#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
25#[cfg_attr(feature = "typescript", ts(export))]
26pub struct CheatGetIdlePersonnelAtRequest {
27  #[builder(start_fn, into)]
28  pub world: WorldId,
29  #[builder(into)]
30  pub coord: Coord,
31}
32
33#[derive(Builder, Clone, Debug, Deserialize, Serialize)]
34#[serde(rename_all = "camelCase")]
35#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
36#[cfg_attr(feature = "typescript", ts(export))]
37pub struct CheatGetManeuversRequest {
38  #[builder(start_fn, into)]
39  pub world: WorldId,
40}
41
42#[derive(Builder, Clone, Debug, Deserialize, Serialize)]
43#[serde(rename_all = "camelCase")]
44#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
45#[cfg_attr(feature = "typescript", ts(export, optional_fields = nullable))]
46pub struct CheatGetManeuversOfRequest {
47  #[builder(start_fn, into)]
48  pub world: WorldId,
49  #[serde(default)]
50  #[builder(into)]
51  pub ruler: Option<Ruler>,
52}
53
54#[derive(Builder, Clone, Debug, Deserialize, Serialize)]
55#[serde(rename_all = "camelCase")]
56#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
57#[cfg_attr(feature = "typescript", ts(export, optional_fields = nullable))]
58pub struct CheatSpawnPersonnelRequest {
59  #[builder(start_fn, into)]
60  pub world: WorldId,
61  #[builder(into)]
62  pub coord: Coord,
63  #[builder(into)]
64  pub personnel: ArmyPersonnel,
65  #[serde(default)]
66  #[builder(into)]
67  pub ruler: Option<Ruler>,
68}