summaryrefslogtreecommitdiff
path: root/src/session.rs
diff options
context:
space:
mode:
authorJomar Milan <jomarm@jomarm.com>2026-05-30 23:06:35 -0700
committerJomar Milan <jomarm@jomarm.com>2026-05-30 23:06:35 -0700
commit90d97e089d3b56e0e9efde3693f106d035bb88e8 (patch)
treee7e68fa9559d5da1e55338991bd293cb36ccbf5e /src/session.rs
parent21be142ed526c5ec88c14c3ea6cad043a075a2b9 (diff)
Add route to accept player hand updates
Diffstat (limited to 'src/session.rs')
-rw-r--r--src/session.rs32
1 files changed, 28 insertions, 4 deletions
diff --git a/src/session.rs b/src/session.rs
index cac100e..11dd5b8 100644
--- a/src/session.rs
+++ b/src/session.rs
@@ -1,12 +1,36 @@
+use serde::Deserialize;
use std::collections::HashMap;
pub struct Session {
pub steam_name: String,
pub passcode: String,
- pub hands: HashMap<String, Hand>
+ pub hands: HashMap<String, Vec<HandObject>>,
}
-pub struct Hand {
+#[derive(Deserialize)]
+pub enum HandObject {
+ CustomDeck(CustomDeck),
+}
+
+#[derive(Deserialize)]
+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,
}
impl Session {
@@ -14,7 +38,7 @@ impl Session {
Session {
steam_name,
passcode,
- hands: HashMap::new()
+ hands: HashMap::new(),
}
}
-} \ No newline at end of file
+}