diff options
| author | salmonik <salmonik@tuta.io> | 2026-10-28 22:28:05 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-10-28 22:28:05 +0100 |
| commit | ea5e7d336719571e51ef14478ab603e71126e3d8 (patch) | |
| tree | 4fb59337501f798e6591701e52b9e785307efd63 /src/bin/client/games/traits.rs | |
| parent | Fix TUI: render_lines 6 for correct MoveUp, drain buffered events before clea... (diff) | |
| download | zagan-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.rs | 32 |
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 @@ | |||
| 1 | use std::collections::HashMap; | ||
| 2 | |||
| 3 | #[derive(Debug, Clone)] | ||
| 4 | pub enum GameError { | ||
| 5 | InvalidAction, | ||
| 6 | NetworkError, | ||
| 7 | } | ||
| 8 | |||
| 9 | #[derive(Debug, Clone, PartialEq)] | ||
| 10 | pub enum GamePhase { | ||
| 11 | WaitingToStart, | ||
| 12 | Playing, | ||
| 13 | Finished, | ||
| 14 | } | ||
| 15 | |||
| 16 | #[derive(Debug, Clone)] | ||
| 17 | pub struct GameState { | ||
| 18 | pub game_type: String, | ||
| 19 | pub bet_amount: u64, | ||
| 20 | pub phase: GamePhase, | ||
| 21 | pub data: HashMap<String, String>, | ||
| 22 | } | ||
| 23 | |||
| 24 | pub 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 | } | ||
