Skip to main content

nil_payload/request/infrastructure/
building.rs

1// Copyright (C) Call of Nil contributors
2// SPDX-License-Identifier: AGPL-3.0-only
3
4use bon::Builder;
5use nil_core::continent::Coord;
6use nil_core::infrastructure::building::BuildingId;
7use nil_core::world::config::WorldId;
8use serde::{Deserialize, Serialize};
9
10#[cfg(feature = "typescript")]
11use ts_rs::TS;
12
13#[derive(Builder, Clone, Debug, Deserialize, Serialize)]
14#[serde(rename_all = "camelCase")]
15#[cfg_attr(feature = "typescript", derive(TS))]
16#[cfg_attr(feature = "typescript", ts(export))]
17pub struct ToggleBuildingRequest {
18  #[builder(start_fn, into)]
19  pub world: WorldId,
20  #[builder(into)]
21  pub coord: Coord,
22  #[builder(into)]
23  pub id: BuildingId,
24  pub enabled: bool,
25}