summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorJustin Worthe <justin@worthe-it.co.za>2019-08-07 18:44:52 +0200
committerJustin Worthe <justin@worthe-it.co.za>2019-08-07 18:44:52 +0200
commitbcf28f2fcb7935b316a5a2f660b065faae51f0d9 (patch)
tree02f01f9c1897435c789146ebaee4339ae1eb0113 /src/game
parentbc6901717058e6ff0609869dcb6e26c15d1e10cc (diff)
There is only one valid move once frozen
Diffstat (limited to 'src/game')
-rw-r--r--src/game/player.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/game/player.rs b/src/game/player.rs
index be9d515..6c2efb2 100644
--- a/src/game/player.rs
+++ b/src/game/player.rs
@@ -82,6 +82,12 @@ impl Player {
.map(|worm| worm.rounds_until_unfrozen > 0)
.unwrap_or(false)
}
+
+ pub fn active_worm_is_frozen_after_tick(&self) -> bool {
+ self.active_worm()
+ .map(|worm| worm.rounds_until_unfrozen > 1)
+ .unwrap_or(false)
+ }
}
#[cfg(test)]