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 nil_payload_macros::FromWorld;
7use serde::{Deserialize, Serialize};
8
9#[derive(Builder, Clone, Debug, Deserialize, Serialize, FromWorld)]
10#[serde(rename_all = "camelCase")]
11#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
12#[cfg_attr(feature = "typescript", ts(export))]
13pub struct GetRoundRequest {
14  #[builder(start_fn, into)]
15  pub world: WorldId,
16}
17
18#[derive(Builder, Clone, Debug, Deserialize, Serialize)]
19#[serde(rename_all = "camelCase")]
20#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
21#[cfg_attr(feature = "typescript", ts(export))]
22pub struct SetPlayerReadyRequest {
23  #[builder(start_fn, into)]
24  pub world: WorldId,
25  pub is_ready: bool,
26}
27
28#[derive(Builder, Clone, Debug, Deserialize, Serialize, FromWorld)]
29#[serde(rename_all = "camelCase")]
30#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
31#[cfg_attr(feature = "typescript", ts(export))]
32pub struct StartRoundRequest {
33  #[builder(start_fn, into)]
34  pub world: WorldId,
35}