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

Method ok_if_robot

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

Ok if the unit is a robot. Errors otherwise. InappropriateUnitType - the unit is not a robot.

(&self)

Source from the content-addressed store, hash-verified

390 ///
391 /// * InappropriateUnitType - the unit is not a robot.
392 pub(crate) fn ok_if_robot(&self) -> Result<(), GameError> {
393 if self.unit_type.is_robot() {
394 Ok(())
395 } else {
396 Err(GameError::InappropriateUnitType)?
397 }
398 }
399
400 /// Ok if the unit is a structure. Errors otherwise.
401 ///

Callers 13

ok_if_can_healMethod · 0.80
damageMethod · 0.80
attack_rangeMethod · 0.80
movement_heatMethod · 0.80
attack_heatMethod · 0.80
movement_cooldownMethod · 0.80
attack_cooldownMethod · 0.80
is_ability_unlockedMethod · 0.80
ability_heatMethod · 0.80
ability_cooldownMethod · 0.80
ability_rangeMethod · 0.80

Calls 1

is_robotMethod · 0.80

Tested by

no test coverage detected