Skip to main content

nil_payload/request/cheat/
city.rs

1// Copyright (C) Call of Nil contributors
2// SPDX-License-Identifier: AGPL-3.0-only
3
4use bon::Builder;
5use nil_core::city::stability::Stability;
6use nil_core::continent::coord::Coord;
7use nil_core::ruler::Ruler;
8use nil_core::world::config::WorldId;
9use serde::{Deserialize, Serialize};
10
11#[cfg(feature = "typescript")]
12use ts_rs::TS;
13
14#[derive(Builder, Clone, Debug, Deserialize, Serialize)]
15#[serde(rename_all = "camelCase")]
16#[cfg_attr(feature = "typescript", derive(TS))]
17#[cfg_attr(feature = "typescript", ts(export))]
18pub struct CheatSetStabilityRequest {
19  #[builder(start_fn, into)]
20  pub world: WorldId,
21  #[builder(into)]
22  pub coord: Coord,
23  #[builder(into)]
24  pub stability: Stability,
25}
26
27#[derive(Builder, Clone, Debug, Deserialize, Serialize)]
28#[serde(rename_all = "camelCase")]
29#[cfg_attr(feature = "typescript", derive(TS))]
30#[cfg_attr(feature = "typescript", ts(export))]
31pub struct CheatSpawnCityRequest {
32  #[builder(start_fn, into)]
33  pub world: WorldId,
34  #[serde(default)]
35  #[builder(into)]
36  pub ruler: Option<Ruler>,
37  #[builder(into)]
38  pub coord: Coord,
39}