check turn stage before rolling dice
This commit is contained in:
parent
50a4038aa6
commit
7d3124030f
|
|
@ -1,9 +1,6 @@
|
|||
use bot::Bot;
|
||||
use pretty_assertions::assert_eq;
|
||||
use std::fmt;
|
||||
use store::{
|
||||
CheckerMove, Color, Dice, DiceRoller, GameEvent, GameState, PlayerId, Stage, TurnStage,
|
||||
};
|
||||
use store::{CheckerMove, DiceRoller, GameEvent, GameState, PlayerId, Stage, TurnStage};
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
pub struct AppArgs {
|
||||
|
|
@ -90,8 +87,6 @@ impl App {
|
|||
}
|
||||
}
|
||||
|
||||
fn get_my_player(&mut self) {}
|
||||
|
||||
pub fn start(&mut self) {
|
||||
self.game.state = GameState::new();
|
||||
}
|
||||
|
|
@ -128,6 +123,10 @@ impl App {
|
|||
println!("player_id not set ");
|
||||
return;
|
||||
}
|
||||
if self.game.state.turn_stage != TurnStage::RollDice {
|
||||
println!("Not in the dice roll stage");
|
||||
return;
|
||||
}
|
||||
let dice = self.game.dice_roller.roll();
|
||||
self.game.handle_event(&GameEvent::RollResult {
|
||||
player_id: self.game.player_id.unwrap(),
|
||||
|
|
|
|||
Loading…
Reference in a new issue