Skip to main content

nil_payload/request/
continent.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::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))]
16pub struct GetContinentSizeRequest {
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 GetPublicFieldRequest {
25  pub world: WorldId,
26  #[builder(into)]
27  pub coord: Coord,
28}
29#[derive(Builder, Clone, Debug, Deserialize, Serialize)]
30#[serde(rename_all = "camelCase")]
31#[cfg_attr(feature = "typescript", derive(TS))]
32#[cfg_attr(feature = "typescript", ts(export))]
33pub struct GetPublicFieldsRequest {
34  pub world: WorldId,
35  #[serde(default)]
36  #[builder(default, with = FromIterator::from_iter)]
37  pub coords: Vec<Coord>,
38}