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

Method new

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

Construct a planet with the given map, where the current karbonite deposits are initialized with the map's initial deposits.

(map: &PlanetMap)

Source from the content-addressed store, hash-verified

97 /// Construct a planet with the given map, where the current karbonite
98 /// deposits are initialized with the map's initial deposits.
99 pub fn new(map: &PlanetMap) -> PlanetInfo {
100 PlanetInfo {
101 visible_locs: vec![vec![true; map.width]; map.height],
102 units: FnvHashMap::default(),
103 units_by_loc: FnvHashMap::default(),
104 karbonite: map.initial_karbonite.clone(),
105 }
106 }
107}
108
109/// Persistent info specific to a single team. Teams are only able to access

Callers

nothing calls this directly

Calls 4

cloneMethod · 0.80
validateMethod · 0.80
insert_unitMethod · 0.80
filterMethod · 0.45

Tested by

no test coverage detected