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::Coord;
6use nil_core::world::config::WorldId;
7use serde::{Deserialize, Serialize};
8
9#[derive(Builder, Clone, Debug, Deserialize, Serialize)]
10#[serde(rename_all = "camelCase")]
11#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
12#[cfg_attr(feature = "typescript", ts(export))]
13pub struct GetContinentSizeRequest {
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 GetPublicFieldRequest {
23  #[builder(start_fn, into)]
24  pub world: WorldId,
25  #[builder(into)]
26  pub coord: Coord,
27}
28#[derive(Builder, Clone, Debug, Deserialize, Serialize)]
29#[serde(rename_all = "camelCase")]
30#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
31#[cfg_attr(feature = "typescript", ts(export))]
32pub struct GetPublicFieldsRequest {
33  #[builder(start_fn, into)]
34  pub world: WorldId,
35  #[serde(default)]
36  #[builder(default, with = FromIterator::from_iter)]
37  pub coords: Vec<Coord>,
38}