Skip to main content

nil_payload/request/cheat/
npc.rs

1// Copyright (C) Call of Nil contributors
2// SPDX-License-Identifier: AGPL-3.0-only
3
4use nil_core::ethic::Ethics;
5use nil_core::infrastructure::Infrastructure;
6use nil_core::npc::bot::BotId;
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(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 CheatGetEthicsRequest {
19  pub world: WorldId,
20  pub ruler: Ruler,
21}
22
23#[derive(Clone, Debug, Deserialize, Serialize)]
24#[serde(rename_all = "camelCase")]
25#[cfg_attr(feature = "typescript", derive(TS))]
26#[cfg_attr(feature = "typescript", ts(export, optional_fields = nullable))]
27pub struct CheatSetBotEthicsRequest {
28  pub world: WorldId,
29  pub id: BotId,
30  #[serde(default)]
31  pub ethics: Option<Ethics>,
32}
33
34#[derive(Clone, Debug, Deserialize, Serialize)]
35#[serde(rename_all = "camelCase")]
36#[cfg_attr(feature = "typescript", derive(TS))]
37#[cfg_attr(feature = "typescript", ts(export, optional_fields = nullable))]
38pub struct CheatSpawnBotRequest {
39  pub world: WorldId,
40  pub name: String,
41  #[serde(default)]
42  pub infrastructure: Option<Infrastructure>,
43}