MCPcopy Index your code
hub / github.com/battlecode/battlecode-2018 / be_healed

Method be_healed

battlecode-engine/src/unit.rs:556–559  ·  view source on GitHub ↗

Increases the unit's current health by the given amount, without healing beyond the unit's maximum health. Returns true if unit is healed to max.

(&mut self, heal_amount: u32)

Source from the content-addressed store, hash-verified

554 /// Increases the unit's current health by the given amount, without healing
555 /// beyond the unit's maximum health. Returns true if unit is healed to max.
556 pub(crate) fn be_healed(&mut self, heal_amount: u32) -> bool {
557 self.health = cmp::min(self.health + heal_amount, self.max_health);
558 self.health == self.max_health
559 }
560
561 // ************************************************************************
562 // *************************** ABILITY METHODS *****************************

Callers 4

repairMethod · 0.80
take_damageMethod · 0.80
be_builtMethod · 0.80
end_roundMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected