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

Method map_location

battlecode-engine/src/location.rs:332–337  ·  view source on GitHub ↗

The map location of the unit. UnitNotOnMap - The unit is in a garrison or in space, and does not have a map location.

(&self)

Source from the content-addressed store, hash-verified

330 /// * UnitNotOnMap - The unit is in a garrison or in space, and does not
331 /// have a map location.
332 pub fn map_location(&self) -> Result<MapLocation, GameError> {
333 match *self {
334 Location::OnMap(map_loc) => Ok(map_loc),
335 _ => Err(GameError::UnitNotOnMap)?,
336 }
337 }
338
339 /// Whether the unit is in a garrison.
340 pub fn is_in_garrison(&self) -> bool {

Callers 15

run.pyFile · 0.80
run.pyFile · 0.80
filterMethod · 0.80
insert_unitMethod · 0.80
ok_if_can_moveMethod · 0.80
attackMethod · 0.80
ok_if_can_harvestMethod · 0.80
harvestMethod · 0.80
ok_if_can_blueprintMethod · 0.80
blueprintMethod · 0.80
ok_if_can_replicateMethod · 0.80
replicateMethod · 0.80

Calls

no outgoing calls

Tested by 1

parse_bananasFunction · 0.64