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

Method begin_snipe

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

Begins the countdown to snipe a given location. Maximizes the units attack and movement heats until the ranger has sniped. The ranger may begin the countdown at any time, including resetting the countdown to snipe a different location. NoSuchUnit - either unit does not exist (inside the vision range). TeamNotAllowed - the ranger is not on the current player's team. UnitNotOnMap - the ranger is no

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

Source from the content-addressed store, hash-verified

1562 /// * ResearchNotUnlocked - you do not have the needed research to use snipe.
1563 /// * Overheated - the ranger is not ready to use snipe again.
1564 pub fn begin_snipe(&mut self, ranger_id: UnitID, location: MapLocation)
1565 -> Result<(), GameError> {
1566 self.ok_if_can_begin_snipe(ranger_id, location)?;
1567 self.ok_if_begin_snipe_ready(ranger_id)?;
1568 self.my_unit_mut(ranger_id).unwrap().begin_snipe(location);
1569 Ok(())
1570 }
1571
1572 fn process_rangers(&mut self) {
1573 let team = self.team();

Callers 1

applyMethod · 0.45

Calls 3

ok_if_can_begin_snipeMethod · 0.80
my_unit_mutMethod · 0.80

Tested by

no test coverage detected