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

Method blink

battlecode-engine/src/world.rs:1642–1649  ·  view source on GitHub ↗

Blinks the mage to the given location. NoSuchUnit - the mage does not exist (inside the vision range). TeamNotAllowed - the mage is not on the current player's team. UnitNotOnMap - the mage is not on the map. InappropriateUnitType - the unit is not a mage. ResearchNotUnlocked - you do not have the needed research to use blink. OutOfRange - the target does not lie within ability range of the mage.

(&mut self, mage_id: UnitID, location: MapLocation)

Source from the content-addressed store, hash-verified

1640 /// * LocationNotEmpty - the target location is already occupied.
1641 /// * Overheated - the mage is not ready to use blink again.
1642 pub fn blink(&mut self, mage_id: UnitID, location: MapLocation) -> Result<(), GameError> {
1643 self.ok_if_can_blink(mage_id, location)?;
1644 self.ok_if_blink_ready(mage_id)?;
1645 self.remove_unit(mage_id);
1646 self.my_unit_mut(mage_id).unwrap().blink(location);
1647 self.place_unit(mage_id);
1648 Ok(())
1649 }
1650
1651 // ************************************************************************
1652 // *************************** HEALER METHODS *****************************

Callers 1

applyMethod · 0.45

Calls 5

ok_if_can_blinkMethod · 0.80
ok_if_blink_readyMethod · 0.80
remove_unitMethod · 0.80
my_unit_mutMethod · 0.80
place_unitMethod · 0.80

Tested by

no test coverage detected