Skip to main content

nil_payload/request/
round.rs

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