1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
use std::collections::HashMap;
#[derive(Debug, Clone)]
pub enum GameError {
InvalidAction,
NetworkError,
}
#[derive(Debug, Clone, PartialEq)]
pub enum GamePhase {
WaitingToStart,
}
#[derive(Debug, Clone)]
pub struct GameState {
pub game_type: String,
pub bet_amount: u64,
pub phase: GamePhase,
pub data: HashMap<String, String>,
}
pub trait Game: Send + Sync {
fn get_name(&self) -> &'static str;
fn render(&self, state: &GameState) -> String;
fn render_lines(&self, state: &GameState) -> usize;
fn get_help(&self) -> String;
}
|