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

Method ok_if_on_map

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

Ok if the unit is on the map. UnitNotOnMap - the unit is not on the map.

(&self)

Source from the content-addressed store, hash-verified

475 ///
476 /// * UnitNotOnMap - the unit is not on the map.
477 pub(crate) fn ok_if_on_map(&self) -> Result<(), GameError> {
478 if !self.location().is_on_map() {
479 Err(GameError::UnitNotOnMap)?;
480 }
481 Ok(())
482 }
483
484 /// Ok if the unit is ready to move. The movement heat must be
485 /// lower than the maximum heat to attack.

Callers 10

ok_if_can_attackMethod · 0.80
ok_if_can_buildMethod · 0.80
ok_if_can_repairMethod · 0.80
ok_if_can_javelinMethod · 0.80
ok_if_can_begin_snipeMethod · 0.80
ok_if_can_blinkMethod · 0.80
ok_if_can_healMethod · 0.80
ok_if_can_overchargeMethod · 0.80
ok_if_can_loadMethod · 0.80
ok_if_can_unloadMethod · 0.80

Calls 2

is_on_mapMethod · 0.80
locationMethod · 0.80

Tested by

no test coverage detected