MCPcopy Create free account
hub / github.com/battlecode/battlecode-2018 / karbonite_at

Method karbonite_at

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

The karbonite at the given location. LocationOffMap - the location is off the map. LocationNotVisible - the location is outside the vision range.

(&self, location: MapLocation)

Source from the content-addressed store, hash-verified

517 /// * LocationOffMap - the location is off the map.
518 /// * LocationNotVisible - the location is outside the vision range.
519 pub fn karbonite_at(&self, location: MapLocation) -> Result<u32, GameError> {
520 self.ok_if_can_sense_location(location)?;
521 Ok(self.my_planet().karbonite[location.y as usize][location.x as usize])
522 }
523
524 /// Returns an array of all locations within a certain radius squared of
525 /// this location that are on the map.

Callers 2

ok_if_can_harvestMethod · 0.45
harvestMethod · 0.45

Calls 2

my_planetMethod · 0.80

Tested by

no test coverage detected