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

Method on_map

battlecode-engine/src/map/mod.rs:328–334  ·  view source on GitHub ↗

Whether a location is on the map.

(&self, location: MapLocation)

Source from the content-addressed store, hash-verified

326
327 /// Whether a location is on the map.
328 pub fn on_map(&self, location: MapLocation) -> bool {
329 self.planet == location.planet
330 && location.x >= 0
331 && location.y >= 0
332 && location.x < self.width as i32
333 && location.y < self.height as i32
334 }
335
336 /// Whether the location on the map contains passable terrain. Is only
337 /// false when the square contains impassable terrain (distinct from

Callers 5

ok_if_can_begin_snipeMethod · 0.80
initial_karbonite_atMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected