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
use serde::{Deserialize, Serialize};

/// A player.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Player {
    pub name: String,
    pub id: String,
    pub controller: String,
    pub state: String,
}

/// A player position, which composes a `Player` and their position (a `(f64, f64, f64)`).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PlayerPosition {
    pub player: Player,
    pub pos: Option<(f64, f64, f64)>,
}

/// Ghost brick data.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GhostBrick {
    #[serde(rename = "targetGrid")]
    pub target_grid: String,
    pub location: (f64, f64, f64),
    pub orientation: String,
}

/// Player paint data.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PlayerPaint {
    #[serde(rename = "materialIndex")]
    pub material_index: String,
    #[serde(rename = "materialAlpha")]
    pub material_alpha: String,
    #[serde(rename = "material")]
    pub material: String,
    #[serde(rename = "color")]
    pub color: (u8, u8, u8),
}

/// Bounds data.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TemplateBounds {
    #[serde(rename = "minBound")]
    pub min_bound: (f64, f64, f64),
    #[serde(rename = "maxBound")]
    pub max_bound: (f64, f64, f64),
    pub center: (f64, f64, f64),
}