summaryrefslogtreecommitdiffstats
path: root/src/client/games/manager.rs
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-10-29 22:55:49 +0100
committersalmonik <salmonik@tuta.io>2026-10-29 22:55:49 +0100
commit49df948de25d28601469e9ca993f33530989ebd0 (patch)
tree291aae0f57d0d7d12a27eb28038e43f942d6b991 /src/client/games/manager.rs
parentv2.4.0: key stored credentials by certificate fingerprint (diff)
downloadzagan-bet-49df948de25d28601469e9ca993f33530989ebd0.tar.gz
zagan-bet-49df948de25d28601469e9ca993f33530989ebd0.zip
v3.0.0: cursor-driven roulette felt with splits and corners; drop schema migrations; require 80x24
Diffstat (limited to 'src/client/games/manager.rs')
-rw-r--r--src/client/games/manager.rs17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/client/games/manager.rs b/src/client/games/manager.rs
index b20ff44..bb2a8b5 100644
--- a/src/client/games/manager.rs
+++ b/src/client/games/manager.rs
@@ -55,7 +55,7 @@ impl GameManager {
55 ); 55 );
56 data.insert("chip".to_string(), "10".to_string()); 56 data.insert("chip".to_string(), "10".to_string());
57 data.insert("status".to_string(), "place".to_string()); 57 data.insert("status".to_string(), "place".to_string());
58 data.insert("number_input".to_string(), String::new()); 58 data.insert("cursor".to_string(), "lattice:0:3".to_string());
59 0 59 0
60 } else if game_type == "blackjack" { 60 } else if game_type == "blackjack" {
61 data.insert("status".to_string(), "ready".to_string()); 61 data.insert("status".to_string(), "ready".to_string());
@@ -234,11 +234,19 @@ impl GameManager {
234 } 234 }
235 } 235 }
236 236
237 pub fn set_roulette_number_input(&mut self, value: &str) { 237 pub fn roulette_cursor(&self) -> crate::client::games::roulette::Cursor {
238 self.current_session
239 .as_ref()
240 .and_then(|session| session.data.get("cursor"))
241 .map(|raw| crate::client::games::roulette::Cursor::parse(raw))
242 .unwrap_or_default()
243 }
244
245 pub fn set_roulette_cursor(&mut self, cursor: &crate::client::games::roulette::Cursor) {
238 if let Some(session) = self.current_session.as_mut() { 246 if let Some(session) = self.current_session.as_mut() {
239 session 247 session
240 .data 248 .data
241 .insert("number_input".to_string(), value.to_string()); 249 .insert("cursor".to_string(), cursor.encoded());
242 } 250 }
243 } 251 }
244 252
@@ -274,9 +282,6 @@ impl GameManager {
274 session 282 session
275 .data 283 .data
276 .insert("status".to_string(), "result".to_string()); 284 .insert("status".to_string(), "result".to_string());
277 session
278 .data
279 .insert("number_input".to_string(), String::new());
280 } 285 }
281 286
282 pub fn apply_blackjack_state(&mut self, state: BlackjackState) { 287 pub fn apply_blackjack_state(&mut self, state: BlackjackState) {