Create a new simple game setup.
This commit is contained in:
parent
04d6837b5e
commit
4e695f3a7e
|
@ -120,17 +120,21 @@ pub enum GameState {
|
||||||
DrawGame,
|
DrawGame,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Player {
|
|
||||||
name: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub struct Game {
|
pub struct Game {
|
||||||
board: Board,
|
board: Board,
|
||||||
light_player: Player,
|
|
||||||
dark_player: Player,
|
|
||||||
state: GameState,
|
state: GameState,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Game {
|
||||||
|
pub fn new(size: BoardSize) -> Game {
|
||||||
|
// TODO: Add the concept of rulesets for the various checkers variants.
|
||||||
|
Game {
|
||||||
|
board: Board::new(size),
|
||||||
|
state: GameState::LightPlayerTurn,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
|
Loading…
Reference in New Issue