1use serde;
7use serde::Deserialize;
8use serde_repr::Deserialize_repr;
9
10#[derive(Debug, Deserialize, Clone, PartialEq, Eq)]
14#[serde(rename_all = "camelCase")]
15pub struct WarDataResponse {
16 pub war_id: String,
17 pub war_number: u32,
18 pub winner: TeamId,
19 pub conquest_start_time: u64,
20 pub conquest_end_time: Option<u64>,
21 pub resistance_start_time: Option<u64>,
22 pub required_victory_towns: u8,
23}
24
25#[derive(Debug, Deserialize, Clone, PartialEq, Eq)]
29#[serde(rename_all = "camelCase")]
30pub struct WarReportResponse {
31 pub total_enlistments: u32,
32 pub colonial_casualties: u32,
33 pub warden_casualties: u32,
34 pub day_of_war: u32,
35}
36
37#[derive(Debug, Clone, PartialEq, Eq)]
41pub struct MapNameResponse {
42 pub maps: Vec<String>,
43}
44
45#[derive(Debug, Deserialize, Clone, PartialEq)]
50#[serde(rename_all = "camelCase")]
51pub struct MapDataResponse {
52 pub region_id: u16,
53 pub scorched_victory_towns: u16,
54 pub map_items: Vec<MapItem>,
55 pub map_text_items: Vec<MapTextItem>,
56 pub last_updated: u64,
57 pub version: u16,
58}
59
60#[derive(Debug, Deserialize, Clone, PartialEq)]
64#[serde(rename_all = "camelCase")]
65pub struct MapItem {
66 pub team_id: TeamId,
67 pub icon_type: IconType,
68 pub x: f32,
69 pub y: f32,
70 pub flags: u16,
71}
72
73#[derive(Debug, Deserialize, Clone, PartialEq)]
77#[serde(rename_all = "camelCase")]
78pub struct MapTextItem {
79 pub text: String,
80 pub x: f32,
81 pub y: f32,
82 pub map_marker_type: MapMarkerType,
83}
84
85#[derive(Deserialize_repr, PartialEq, Debug, Clone)]
89#[repr(u16)]
90pub enum IconType {
91 StaticBase = 5,
92 StaticBase2 = 6,
93 StaticBase3 = 7,
94 ForwardBase1 = 8,
95 ForwardBase2 = 9,
96 ForwardBase3 = 10,
97 Hospital = 11,
98 VehicleFactory = 12,
99 Armory = 13,
100 SupplyStation = 14,
101 Workshop = 15,
102 ManufacturingPlant = 16,
103 Refinery = 17,
104 Shipyard = 18,
105 TechCenter = 19,
106 SalvageField = 20,
107 ComponentField = 21,
108 FuelField = 22,
109 SulfurField = 23,
110 WorldMapTent = 24,
111 TravelTent = 25,
112 TrainingArea = 26,
113 SpecialBase = 27,
114 ObservationTower = 28,
115 Fort = 29,
116 TroopShip = 30,
117 SulfurMine = 32,
118 StorageFacility = 33,
119 Factory = 34,
120 GarrisonStation = 35,
121 AmmoFactory = 36,
122 RocketSite = 37,
123 SalvageMine = 38,
124 ConstructionYard = 39,
125 ComponentMine = 40,
126 OilWell = 41,
127 RelicBase1 = 45,
128 RelicBase2 = 46,
129 RelicBase3 = 47,
130 MassProductionFactory = 51,
131 Seaport = 52,
132 CoastalGun = 53,
133 SoulFactory = 54,
134 TownBase1 = 56,
135 TownBase2 = 57,
136 TownBase3 = 58,
137 StormCannon = 59,
138 IntelCenter = 60,
139 CoalField = 61,
140 OilField = 62,
141 RocketTarget = 70,
142 RocketGroundZero = 71,
143 RocketSiteWithRocket = 72,
144 FacilityMineOilRig = 75,
145}
146
147#[derive(Debug, Deserialize, Clone, PartialEq, Eq)]
149#[serde(rename_all = "UPPERCASE")]
150pub enum TeamId {
151 None,
152 Wardens,
153 Colonials,
154}
155
156#[derive(Debug, Deserialize, Clone, PartialEq, Eq)]
158pub enum MapMarkerType {
159 Major,
160 Minor,
161}