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

Method damage_location

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

Deals damage to any unit in the target square, potentially destroying it.

(&mut self, location: MapLocation, damage: i32)

Source from the content-addressed store, hash-verified

1067
1068 /// Deals damage to any unit in the target square, potentially destroying it.
1069 fn damage_location(&mut self, location: MapLocation, damage: i32) {
1070 let id = if let Some(id) = self.my_planet().units_by_loc.get(&location) {
1071 *id
1072 } else {
1073 return;
1074 };
1075
1076 self.damage_unit(id, damage)
1077 }
1078
1079 /// * NoSuchUnit - the unit does not exist (inside the vision range).
1080 /// * TeamNotAllowed - the unit is not on the current player's team.

Callers 4

attackMethod · 0.80
process_rangersMethod · 0.80
launch_rocketMethod · 0.80
land_rocketMethod · 0.80

Calls 2

my_planetMethod · 0.80
damage_unitMethod · 0.80

Tested by

no test coverage detected