Skip to main content

nil_payload/response/npc/
precursor.rs

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