MCPcopy Create free account
hub / github.com/battlecode/battlecode-2018 / ok_if_can_be_overcharged

Method ok_if_can_be_overcharged

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

Returns OK if the unit can be overcharged. The unit must be a robot and not a healer. InappropriateUnitType - the unit is not a robot or is a healer.

(& self)

Source from the content-addressed store, hash-verified

886 ///
887 /// * InappropriateUnitType - the unit is not a robot or is a healer.
888 pub(crate) fn ok_if_can_be_overcharged(& self) -> Result<(), GameError> {
889 self.ok_if_robot()?;
890 if self.ok_if_unit_type(Healer).is_ok() {
891 Err(GameError::InappropriateUnitType)?
892 }
893 Ok(())
894 }
895
896 /// Resets a unit's move, attack, and ability cooldowns.
897 pub(crate) fn be_overcharged(&mut self) {

Callers 1

ok_if_can_overchargeMethod · 0.80

Calls 2

ok_if_robotMethod · 0.80
ok_if_unit_typeMethod · 0.80

Tested by

no test coverage detected