1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
use std::collections::HashMap;
use serde::{Deserialize, Serialize};
use serde_json::Value;

#[derive(Serialize, Deserialize, Debug)]
pub struct WarInfo {
    #[serde(rename = "warId")]
    pub war_id: i64,
    #[serde(rename = "startDate")]
    pub start_date: i64,
    #[serde(rename = "endDate")]
    pub end_date: i64,
    #[serde(rename = "minimumClientVersion")]
    pub minimum_client_version: String,
    #[serde(rename = "planetInfos")]
    pub planet_infos: Vec<PlanetInfo>,
    #[serde(rename = "homeWorlds")]
    pub home_worlds: Vec<HomeWorld>,
    // #[serde(rename = "capitalInfos")]
    // pub capital_infos: Vec<String>,  // ToDo: Don't know the structure of capital_infos yet
    // #[serde(rename = "planetPermanentEffects")]
    // pub planet_permanent_effects: Vec<String>, // ToDo: Don't know the structure of planet_permanent_effects yet
    #[serde(flatten)]
    pub unknown: HashMap<String, Value>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct HomeWorld {
    pub race: i64,
    #[serde(rename = "planetIndices")]
    pub planet_indices: Vec<i64>,
    #[serde(flatten)]
    pub unknown: HashMap<String, Value>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct Position {
    pub x: f64,
    pub y: f64,
    #[serde(flatten)]
    pub unknown: HashMap<String, Value>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct PlanetInfo {
    pub index: i64,
    #[serde(rename = "settingsHash")]
    pub settings_hash: i64,
    pub position: Position,
    pub waypoints: Vec<i64>,
    pub sector: i64,
    #[serde(rename = "maxHealth")]
    pub max_health: i64,
    pub disabled: bool,
    #[serde(rename = "initialOwner")]
    pub initial_owner: i64,
    #[serde(skip)]
    pub planet_name: String,
    #[serde(flatten)]
    pub unknown: HashMap<String, Value>,
}