summaryrefslogtreecommitdiff
path: root/src/game/player.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/player.rs')
-rw-r--r--src/game/player.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/game/player.rs b/src/game/player.rs
index 6c2efb2..0d24e60 100644
--- a/src/game/player.rs
+++ b/src/game/player.rs
@@ -46,6 +46,10 @@ impl Player {
self.worms.iter().map(|w| w.health).sum()
}
+ pub fn max_worm_health(&self) -> i32 {
+ self.worms.iter().map(|w| w.health).max().unwrap_or(0)
+ }
+
pub fn clear_dead_worms(&mut self) {
for worm_index in (0..self.worms.len()).rev() {
if self.worms[worm_index].health <= 0 {