diff options
author | Justin Worthe <justin@worthe-it.co.za> | 2019-07-08 22:31:41 +0200 |
---|---|---|
committer | Justin Worthe <justin@worthe-it.co.za> | 2019-07-08 22:31:41 +0200 |
commit | 770f14609849552d965b4e9101bfb5c0870c08d0 (patch) | |
tree | 170ebb08b86ccc5027752f37bf0dda4be516a2b7 /src/game.rs | |
parent | 2d4647a618234ef496899d875f75d57b5af1a6e5 (diff) |
Command filtering to avoid wasting the selects
Diffstat (limited to 'src/game.rs')
-rw-r--r-- | src/game.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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) |