Skip to main content

nil_payload/request/cheat/
player.rs

1// Copyright (C) Call of Nil contributors
2// SPDX-License-Identifier: AGPL-3.0-only
3
4use bon::Builder;
5use nil_core::player::PlayerId;
6use nil_core::world::config::WorldId;
7use serde::{Deserialize, Serialize};
8
9#[cfg(feature = "typescript")]
10use ts_rs::TS;
11
12#[derive(Builder, Clone, Debug, Deserialize, Serialize)]
13#[serde(rename_all = "camelCase")]
14#[cfg_attr(feature = "typescript", derive(TS))]
15#[cfg_attr(feature = "typescript", ts(export, optional_fields = nullable))]
16pub struct CheatGetPlayerRequest {
17  pub world: WorldId,
18  #[serde(default)]
19  #[builder(into)]
20  pub player: Option<PlayerId>,
21}
22
23#[derive(Builder, Clone, Debug, Deserialize, Serialize)]
24#[serde(rename_all = "camelCase")]
25#[cfg_attr(feature = "typescript", derive(TS))]
26#[cfg_attr(feature = "typescript", ts(export))]
27pub struct CheatGetPlayersRequest {
28  pub world: WorldId,
29}