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
63
64
65
66
67
68
69
70
71
72
73
use crate::fillable::{Fillable, Filler};
use crate::SchemaExample;
use df_st_derive::{Fillable, Filler, HashAndPartialEqById};
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct WorldMapImages {
    pub detailed: Option<MapImage>,
    pub world_map: Option<MapImage>,
    pub biome: Option<MapImage>,
    pub diplomacy: Option<MapImage>,
    pub drainage: Option<MapImage>,
    pub elevation: Option<MapImage>,
    pub elevation_water: Option<MapImage>,
    pub evil: Option<MapImage>,
    pub hydrologic: Option<MapImage>,
    pub nobility: Option<MapImage>,
    pub rainfall: Option<MapImage>,
    pub salinity: Option<MapImage>,
    pub savagery: Option<MapImage>,
    // `str`
    pub cadaster: Option<MapImage>,
    pub temperature: Option<MapImage>,
    pub trade: Option<MapImage>,
    pub vegetation: Option<MapImage>,
    pub volcanism: Option<MapImage>,
}

#[derive(
    Serialize,
    Deserialize,
    Clone,
    Debug,
    HashAndPartialEqById,
    Fillable,
    Filler,
    Default,
    JsonSchema,
)]
pub struct MapImage {
    pub id: i32,
    pub name: String,
    #[serde(skip)]
    pub data: Vec<u8>,
    pub format: String,
}

impl WorldMapImages {
    /// Create a new world map image collection
    pub fn new() -> Self {
        Self::default()
    }
}

impl SchemaExample for WorldMapImages {
    fn example() -> Self {
        Self::default()
    }
}

impl MapImage {
    /// Create a new world map image
    pub fn new() -> Self {
        Self::default()
    }
}

impl SchemaExample for MapImage {
    fn example() -> Self {
        Self::default()
    }
}