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

Method ok_if_can_begin_snipe

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

Source from the content-addressed store, hash-verified

1520 // ************************************************************************
1521
1522 fn ok_if_can_begin_snipe(&self, ranger_id: UnitID, location: MapLocation) -> Result<(), GameError> {
1523 let ranger = self.my_unit(ranger_id)?;
1524 ranger.ok_if_on_map()?;
1525 ranger.ok_if_snipe_unlocked()?;
1526 let planet = self.planet();
1527 if !self.starting_map(planet).on_map(location) {
1528 Err(GameError::LocationOffMap)?
1529 }
1530 Ok(())
1531 }
1532
1533 /// Whether the ranger can begin to snipe the given location, without
1534 /// taking into account the ranger's ability heat. Takes into account only

Callers 2

can_begin_snipeMethod · 0.80
begin_snipeMethod · 0.80

Calls 6

my_unitMethod · 0.80
ok_if_on_mapMethod · 0.80
ok_if_snipe_unlockedMethod · 0.80
on_mapMethod · 0.80
planetMethod · 0.45
starting_mapMethod · 0.45

Tested by

no test coverage detected