artifacts/models/
map_schema.rs

1use crate::models;
2use serde::{Deserialize, Serialize};
3
4#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
5#[cfg_attr(feature = "specta", derive(specta::Type))]
6pub struct MapSchema {
7    /// ID of the map.
8    #[serde(rename = "map_id")]
9    pub map_id: i32,
10    /// Name of the map.
11    #[serde(rename = "name")]
12    pub name: String,
13    /// Skin of the map.
14    #[serde(rename = "skin")]
15    pub skin: String,
16    /// Position X of the map.
17    #[serde(rename = "x")]
18    pub x: i32,
19    /// Position Y of the map.
20    #[serde(rename = "y")]
21    pub y: i32,
22    /// Layer of the map.
23    #[serde(rename = "layer")]
24    pub layer: models::MapLayer,
25    /// Access information for the map
26    #[serde(rename = "access")]
27    pub access: Box<models::AccessSchema>,
28    /// Interactions available on this map.
29    #[serde(rename = "interactions")]
30    pub interactions: Box<models::InteractionSchema>,
31}
32
33impl MapSchema {
34    pub fn new(
35        map_id: i32,
36        name: String,
37        skin: String,
38        x: i32,
39        y: i32,
40        layer: models::MapLayer,
41        access: models::AccessSchema,
42        interactions: models::InteractionSchema,
43    ) -> MapSchema {
44        MapSchema {
45            map_id,
46            name,
47            skin,
48            x,
49            y,
50            layer,
51            access: Box::new(access),
52            interactions: Box::new(interactions),
53        }
54    }
55}