summaryrefslogtreecommitdiff
path: root/src/strategy/mcts.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/strategy/mcts.rs')
-rw-r--r--src/strategy/mcts.rs17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/strategy/mcts.rs b/src/strategy/mcts.rs
index e393685..5a43c6e 100644
--- a/src/strategy/mcts.rs
+++ b/src/strategy/mcts.rs
@@ -164,8 +164,8 @@ fn mcts(node: &mut Node) -> Score {
}
fn mcts_move_combo(state: &GameBoard) -> Vec<[Command; 2]> {
- let player_moves = valid_moves(state, 0);
- let opponent_moves = valid_moves(state, 1);
+ let player_moves = self.valid_moves(0);
+ let opponent_moves = self.valid_moves(1);
debug_assert!(!player_moves.is_empty(), "No player moves");
debug_assert!(!opponent_moves.is_empty(), "No opponent moves");
@@ -229,15 +229,4 @@ fn update(node: &mut Node, commands: [Command; 2], score: Score) {
node.score_sum += score;
}
-// TODO: Move into game.rs
-// TODO: Include snowball commands
-fn valid_moves(state: &GameBoard, player_index: usize) -> Vec<Command> {
- state
- .valid_shoot_commands(player_index)
- .iter()
- .chain(state.valid_move_commands(player_index).iter())
- .chain(state.valid_bomb_commands(player_index).iter())
- .chain([Command::new(Action::DoNothing)].iter())
- .cloned()
- .collect()
-}
+