fix(bot): raise error on empty get_legal_actions

This commit is contained in:
Henri Bourcereau 2026-02-27 18:08:21 +01:00
parent 6840d371fc
commit 72eb60f322
3 changed files with 27 additions and 25 deletions

View file

@ -43,10 +43,10 @@ impl TricTrac {
fn get_legal_actions(&self, player_idx: u64) -> Vec<usize> {
if player_idx == self.current_player_idx() {
if player_idx == 0 {
get_valid_action_indices(&self.game_state)
get_valid_action_indices(&self.game_state).unwrap()
} else {
let mirror = self.game_state.mirror();
get_valid_action_indices(&mirror)
get_valid_action_indices(&mirror).unwrap()
}
} else {
vec![]