summaryrefslogtreecommitdiff
path: root/src/strategy.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/strategy.rs')
-rw-r--r--src/strategy.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/strategy.rs b/src/strategy.rs
index afebd12..dd15854 100644
--- a/src/strategy.rs
+++ b/src/strategy.rs
@@ -1,5 +1,5 @@
use crate::command::Command;
-use crate::game::{GameBoard, CellType};
+use crate::game::GameBoard;
use crate::geometry::*;
struct GameTree {
@@ -54,8 +54,8 @@ fn valid_moves(state: &GameBoard, player_index: usize) -> Vec<Command> {
.map(Direction::as_vec)
.map(|d| worm.position + d)
.filter_map(|p| match state.map.at(p) {
- Some(CellType::Air) => Some(Command::Move(p.x, p.y)),
- Some(CellType::Dirt) => Some(Command::Dig(p.x, p.y)),
+ Some(false) => Some(Command::Move(p.x, p.y)),
+ Some(true) => Some(Command::Dig(p.x, p.y)),
_ => None
})
.collect::<Vec<_>>();