nil_payload/response/
military.rs1use derive_more::{Deref, DerefMut, Display, From, Into};
5use nil_core::continent::coord::Coord;
6use nil_core::military::army::Army;
7use nil_core::military::maneuver::{Maneuver, ManeuverId};
8use nil_core::ruler::Ruler;
9use serde::{Deserialize, Serialize};
10use std::collections::HashSet;
11
12#[cfg(feature = "axum")]
13use nil_payload_macros::IntoJsonResponse;
14
15#[derive(Clone, Debug, Deref, DerefMut, From, Into, Deserialize, Serialize)]
16#[cfg_attr(feature = "axum", derive(IntoJsonResponse))]
17#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
18#[cfg_attr(feature = "typescript", ts(export))]
19pub struct GetArmiesResponse(pub Vec<(Coord, Army)>);
20
21#[derive(Clone, Debug, Deref, DerefMut, From, Into, Deserialize, Serialize)]
22#[cfg_attr(feature = "axum", derive(IntoJsonResponse))]
23#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
24#[cfg_attr(feature = "typescript", ts(export))]
25pub struct GetArmyResponse(pub Army);
26
27#[derive(Clone, Debug, Deref, DerefMut, From, Into, Deserialize, Serialize)]
28#[cfg_attr(feature = "axum", derive(IntoJsonResponse))]
29#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
30#[cfg_attr(feature = "typescript", ts(export))]
31pub struct GetArmyOwnerResponse(pub Ruler);
32
33#[derive(Clone, Debug, Deref, DerefMut, From, Into, Deserialize, Serialize)]
34#[cfg_attr(feature = "axum", derive(IntoJsonResponse))]
35#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
36#[cfg_attr(feature = "typescript", ts(export))]
37pub struct GetIdleArmiesAtResponse(pub Vec<Army>);
38
39#[derive(Clone, Debug, Deref, DerefMut, From, Into, Deserialize, Serialize)]
40#[cfg_attr(feature = "axum", derive(IntoJsonResponse))]
41#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
42#[cfg_attr(feature = "typescript", ts(export))]
43pub struct GetIdleArmiesCoordsResponse(pub HashSet<Coord>);
44
45#[derive(Clone, Debug, Deref, DerefMut, From, Into, Deserialize, Serialize)]
46#[cfg_attr(feature = "axum", derive(IntoJsonResponse))]
47#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
48#[cfg_attr(feature = "typescript", ts(export))]
49pub struct GetManeuverResponse(pub Option<Maneuver>);
50
51#[derive(Clone, Copy, Debug, Deref, DerefMut, Display, From, Into, Deserialize, Serialize)]
52#[cfg_attr(feature = "axum", derive(IntoJsonResponse))]
53#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
54#[cfg_attr(feature = "typescript", ts(export))]
55pub struct RequestManeuverResponse(pub ManeuverId);