From 770f14609849552d965b4e9101bfb5c0870c08d0 Mon Sep 17 00:00:00 2001 From: Justin Worthe Date: Mon, 8 Jul 2019 22:31:41 +0200 Subject: Command filtering to avoid wasting the selects --- src/game.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/game.rs') diff --git a/src/game.rs b/src/game.rs index 4e074ea..c31f64f 100644 --- a/src/game.rs +++ b/src/game.rs @@ -458,7 +458,7 @@ impl GameBoard { } pub fn valid_moves_for_worm(&self, worm: &Worm) -> ArrayVec<[Action; 8]> { - Direction::all() + Direction::ALL .iter() .map(Direction::as_vec) .map(|d| worm.position + d) @@ -491,7 +491,7 @@ impl GameBoard { } pub fn valid_shoot_commands(&self, player_index: usize) -> ArrayVec<[Command; 24]> { - let all_dirs = Direction::all(); + let all_dirs = Direction::ALL; let no_select = all_dirs.iter().map(|d| Command::new(Action::Shoot(*d))); self.valid_selects(player_index) -- cgit v1.2.3