wip: relevé
This commit is contained in:
parent
fc58768006
commit
18bd87e68f
2 changed files with 58 additions and 2 deletions
|
|
@ -105,6 +105,7 @@ impl App {
|
|||
"history" => self.show_history(),
|
||||
"quit" => self.quit(),
|
||||
"roll" => self.roll_dice(),
|
||||
"go" => self.go(),
|
||||
_ => self.add_move(input),
|
||||
}
|
||||
println!("{}", self.display());
|
||||
|
|
@ -152,6 +153,20 @@ impl App {
|
|||
});
|
||||
}
|
||||
|
||||
fn go(&mut self) {
|
||||
if self.game.player_id.is_none() {
|
||||
println!("player_id not set ");
|
||||
return;
|
||||
}
|
||||
if self.game.state.turn_stage != TurnStage::HoldOrGoChoice {
|
||||
println!("Not in position to go");
|
||||
return;
|
||||
}
|
||||
self.game.handle_event(&GameEvent::Go {
|
||||
player_id: self.game.player_id.unwrap(),
|
||||
});
|
||||
}
|
||||
|
||||
fn add_move(&mut self, input: &str) {
|
||||
if self.game.player_id.is_none() {
|
||||
println!("player_id not set ");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue