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

Method ok_if_can_blink

battlecode-engine/src/world.rs:1598–1607  ·  view source on GitHub ↗
(&self, mage_id: UnitID, location: MapLocation)

Source from the content-addressed store, hash-verified

1596 // ************************************************************************
1597
1598 fn ok_if_can_blink(&self, mage_id: UnitID, location: MapLocation) -> Result<(), GameError> {
1599 let mage = self.my_unit(mage_id)?;
1600 mage.ok_if_on_map()?;
1601 mage.ok_if_blink_unlocked()?;
1602 mage.ok_if_within_ability_range(OnMap(location))?;
1603 if !self.is_occupiable(location)? {
1604 Err(GameError::LocationNotEmpty)?;
1605 }
1606 Ok(())
1607 }
1608
1609 /// Whether the mage can blink to the given location, without taking into
1610 /// account the mage's ability heat. Takes into account only the mage's

Callers 2

can_blinkMethod · 0.80
blinkMethod · 0.80

Calls 5

my_unitMethod · 0.80
ok_if_on_mapMethod · 0.80
ok_if_blink_unlockedMethod · 0.80
is_occupiableMethod · 0.45

Tested by

no test coverage detected