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 nil_payload_macros::FromWorld;
8use serde::{Deserialize, Serialize};
9
10#[derive(Builder, Clone, Debug, Deserialize, Serialize)]
11#[serde(rename_all = "camelCase")]
12#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
13#[cfg_attr(feature = "typescript", ts(export, optional_fields = nullable))]
14pub struct CheatGetPlayerRequest {
15  #[builder(start_fn, into)]
16  pub world: WorldId,
17  #[serde(default)]
18  #[builder(into)]
19  pub player: Option<PlayerId>,
20}
21
22#[derive(Builder, Clone, Debug, Deserialize, Serialize, FromWorld)]
23#[serde(rename_all = "camelCase")]
24#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
25#[cfg_attr(feature = "typescript", ts(export))]
26pub struct CheatGetPlayersRequest {
27  #[builder(start_fn, into)]
28  pub world: WorldId,
29}