Skip to main content

nil_payload/response/
continent.rs

1// Copyright (C) Call of Nil contributors
2// SPDX-License-Identifier: AGPL-3.0-only
3
4use derive_more::{Deref, DerefMut, Display, From, Into};
5use nil_core::continent::coord::Coord;
6use nil_core::continent::field::PublicField;
7use nil_core::continent::size::ContinentSize;
8use serde::{Deserialize, Serialize};
9
10#[cfg(feature = "axum")]
11use nil_payload_macros::IntoJsonResponse;
12
13#[derive(Clone, Copy, Debug, Deref, DerefMut, Display, From, Into, Deserialize, Serialize)]
14#[cfg_attr(feature = "axum", derive(IntoJsonResponse))]
15#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
16#[cfg_attr(feature = "typescript", ts(export))]
17pub struct GetContinentSizeResponse(pub ContinentSize);
18
19#[derive(Clone, Debug, Deref, DerefMut, From, Into, Deserialize, Serialize)]
20#[cfg_attr(feature = "axum", derive(IntoJsonResponse))]
21#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
22#[cfg_attr(feature = "typescript", ts(export))]
23pub struct GetPublicFieldResponse(pub PublicField);
24
25#[derive(Clone, Debug, Deref, DerefMut, From, Into, Deserialize, Serialize)]
26#[cfg_attr(feature = "axum", derive(IntoJsonResponse))]
27#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
28#[cfg_attr(feature = "typescript", ts(export))]
29pub struct GetPublicFieldsResponse(pub Vec<(Coord, PublicField)>);