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 nil_payload_macros::FromWorld;
10use serde::{Deserialize, Serialize};
11
12#[derive(Builder, Clone, Debug, Deserialize, Serialize)]
13#[serde(rename_all = "camelCase")]
14#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
15#[cfg_attr(feature = "typescript", ts(export))]
16pub struct CheatGetIdleArmiesAtRequest {
17  #[builder(start_fn, into)]
18  pub world: WorldId,
19  #[builder(into)]
20  pub coord: Coord,
21}
22
23#[derive(Builder, Clone, Debug, Deserialize, Serialize)]
24#[serde(rename_all = "camelCase")]
25#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
26#[cfg_attr(feature = "typescript", ts(export))]
27pub struct CheatGetIdlePersonnelAtRequest {
28  #[builder(start_fn, into)]
29  pub world: WorldId,
30  #[builder(into)]
31  pub coord: Coord,
32}
33
34#[derive(Builder, Clone, Debug, Deserialize, Serialize, FromWorld)]
35#[serde(rename_all = "camelCase")]
36#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
37#[cfg_attr(feature = "typescript", ts(export))]
38pub struct CheatGetManeuversRequest {
39  #[builder(start_fn, into)]
40  pub world: WorldId,
41}
42
43#[derive(Builder, Clone, Debug, Deserialize, Serialize)]
44#[serde(rename_all = "camelCase")]
45#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
46#[cfg_attr(feature = "typescript", ts(export, optional_fields = nullable))]
47pub struct CheatGetManeuversOfRequest {
48  #[builder(start_fn, into)]
49  pub world: WorldId,
50  #[serde(default)]
51  #[builder(into)]
52  pub ruler: Option<Ruler>,
53}
54
55#[derive(Builder, Clone, Debug, Deserialize, Serialize)]
56#[serde(rename_all = "camelCase")]
57#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
58#[cfg_attr(feature = "typescript", ts(export, optional_fields = nullable))]
59pub struct CheatSpawnPersonnelRequest {
60  #[builder(start_fn, into)]
61  pub world: WorldId,
62  #[builder(into)]
63  pub coord: Coord,
64  #[builder(into)]
65  pub personnel: ArmyPersonnel,
66  #[serde(default)]
67  #[builder(into)]
68  pub ruler: Option<Ruler>,
69}