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

Method process_rangers

battlecode-engine/src/world.rs:1572–1592  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

1570 }
1571
1572 fn process_rangers(&mut self) {
1573 let team = self.team();
1574 let mut targets: Vec<(MapLocation, i32, UnitID)> = vec![];
1575
1576 for unit in self.my_planet_mut().units.values_mut() {
1577 if unit.team() == team && unit.unit_type() == UnitType::Ranger {
1578 let target = unit.process_snipe();
1579 if let Some(target) = target {
1580 targets.push((target, unit.damage().unwrap(), unit.id()));
1581 }
1582 }
1583 }
1584
1585 for (target, damage, id) in targets {
1586 self.damage_location(target, damage);
1587 self.viewer_changes.push(ViewerDelta::RangerSnipe {
1588 ranger_id: id,
1589 target_location: target
1590 });
1591 }
1592 }
1593
1594 // ************************************************************************
1595 // **************************** MAGE METHODS ******************************

Callers 1

end_turnMethod · 0.80

Calls 7

my_planet_mutMethod · 0.80
unit_typeMethod · 0.80
process_snipeMethod · 0.80
damageMethod · 0.80
idMethod · 0.80
damage_locationMethod · 0.80
teamMethod · 0.45

Tested by

no test coverage detected