summaryrefslogtreecommitdiff
path: root/src/session.rs
blob: acd761588e8b3ef7810647fd883017f011c65fa8 (plain)
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
use serde::{Deserialize, Serialize};
use std::collections::HashMap;

pub struct Session {
    pub steam_name: String,
    pub seats: HashMap<String, Seat>,
}

#[derive(Clone, Serialize, Deserialize)]
pub enum HandObject {
    CustomDeck(CustomDeck),
}

// TODO: These fields will be used in the future. When they are, the dead_code lint should no longer
//       be suppressed.
#[derive(Clone, Serialize, Deserialize)]
#[allow(dead_code)]
pub struct CustomDeck {
    /// The path/URL of the face cardsheet.
    face: String,
    /// The path/URL of the back cardsheet or card back.
    back: String,
    /// If each card has a unique card back (via a cardsheet).
    unique_back: bool,
    /// The number of columns on the cardsheet.
    width: f64,
    /// The number of rows on the cardsheet.
    height: f64,
    /// The number of cards on the cardsheet.
    number: f64,
    /// Whether the cards are horizontal, instead of vertical.
    sideways: bool,
    /// Whether the card back should be used as the hidden image (instead of the last slot of the
    /// `face` image).
    back_is_hidden: bool,
    /// ID of the custom card within the deck.
    card_id: f64,
}

pub struct Seat {
    pub hand: Vec<HandObject>,
}

impl Session {
    pub fn new(steam_name: String) -> Self {
        Session {
            steam_name,
            seats: HashMap::new(),
        }
    }
}