summaryrefslogtreecommitdiffstats
path: root/src/bin/client/games/traits.rs
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-10-28 22:28:05 +0100
committersalmonik <salmonik@tuta.io>2026-10-28 22:28:05 +0100
commitea5e7d336719571e51ef14478ab603e71126e3d8 (patch)
tree4fb59337501f798e6591701e52b9e785307efd63 /src/bin/client/games/traits.rs
parentFix TUI: render_lines 6 for correct MoveUp, drain buffered events before clea... (diff)
downloadzagan-bet-ea5e7d336719571e51ef14478ab603e71126e3d8.tar.gz
zagan-bet-ea5e7d336719571e51ef14478ab603e71126e3d8.zip
v0.2.2: split client/server logic into the library
Diffstat (limited to 'src/bin/client/games/traits.rs')
-rw-r--r--src/bin/client/games/traits.rs32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/bin/client/games/traits.rs b/src/bin/client/games/traits.rs
deleted file mode 100644
index aed0c24..0000000
--- a/src/bin/client/games/traits.rs
+++ /dev/null
@@ -1,32 +0,0 @@
1use std::collections::HashMap;
2
3#[derive(Debug, Clone)]
4pub enum GameError {
5 InvalidAction,
6 NetworkError,
7}
8
9#[derive(Debug, Clone, PartialEq)]
10pub enum GamePhase {
11 WaitingToStart,
12 Playing,
13 Finished,
14}
15
16#[derive(Debug, Clone)]
17pub struct GameState {
18 pub game_type: String,
19 pub bet_amount: u64,
20 pub phase: GamePhase,
21 pub data: HashMap<String, String>,
22}
23
24pub trait Game: Send + Sync {
25 fn get_name(&self) -> &'static str;
26
27 fn render(&self, state: &GameState) -> String;
28
29 fn render_lines(&self, state: &GameState) -> usize;
30
31 fn get_help(&self) -> String;
32}