wip debug default bot mirror

This commit is contained in:
Henri Bourcereau 2025-08-06 17:33:26 +02:00
parent 3dce910bea
commit be027c8ec4
2 changed files with 18 additions and 2 deletions

View file

@ -377,10 +377,12 @@ impl GameState {
}
// Check player is currently the one making their move
if self.active_player_id != *player_id {
error!("Player not active : {}", self.active_player_id);
return false;
}
// Check the player can leave (ie the game is in the KeepOrLeaveChoice stage)
if self.turn_stage != TurnStage::HoldOrGoChoice {
error!("bad stage {:?}", self.turn_stage);
return false;
}
}
@ -517,7 +519,9 @@ impl GameState {
// the points earned by the opponent will be marked on its turn
let new_hole = self.mark_points(self.active_player_id, self.dice_points.0);
if new_hole {
if self.get_active_player().unwrap().holes > 12 {
let holes_count = self.get_active_player().unwrap().holes;
println!("new hole -> {:?}", holes_count);
if holes_count > 12 {
self.stage = Stage::Ended;
} else {
self.turn_stage = TurnStage::HoldOrGoChoice;