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  #[builder(start_fn, into)]
18  pub world: WorldId,
19  #[serde(default)]
20  #[builder(into)]
21  pub player: Option<PlayerId>,
22}
23
24#[derive(Builder, Clone, Debug, Deserialize, Serialize)]
25#[serde(rename_all = "camelCase")]
26#[cfg_attr(feature = "typescript", derive(TS))]
27#[cfg_attr(feature = "typescript", ts(export))]
28pub struct CheatGetPlayersRequest {
29  #[builder(start_fn, into)]
30  pub world: WorldId,
31}