wip (tests fails)

This commit is contained in:
Henri Bourcereau 2025-08-16 16:39:25 +02:00
parent 56d155b911
commit c1e99a5f35
4 changed files with 24 additions and 7 deletions

View file

@ -338,7 +338,7 @@ impl GameState {
return false;
}
}
Roll { player_id } | RollResult { player_id, dice: _ } => {
Roll { player_id } => {
// Check player exists
if !self.players.contains_key(player_id) {
return false;
@ -347,6 +347,26 @@ impl GameState {
if self.active_player_id != *player_id {
return false;
}
// Check the turn stage
if self.turn_stage != TurnStage::RollWaiting {
error!("bad stage {:?}", self.turn_stage);
return false;
}
}
RollResult { player_id, dice: _ } => {
// Check player exists
if !self.players.contains_key(player_id) {
return false;
}
// Check player is currently the one making their move
if self.active_player_id != *player_id {
return false;
}
// Check the turn stage
if self.turn_stage != TurnStage::RollDice {
error!("bad stage {:?}", self.turn_stage);
return false;
}
}
Mark {
player_id,