From 90d97e089d3b56e0e9efde3693f106d035bb88e8 Mon Sep 17 00:00:00 2001 From: Jomar Milan Date: Sat, 30 May 2026 23:06:35 -0700 Subject: Add route to accept player hand updates --- src/session.rs | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) (limited to 'src/session.rs') 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 + pub hands: HashMap>, } -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 +} -- cgit v1.2.3