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

Method end_round

battlecode-engine/src/team_array.rs:100–108  ·  view source on GitHub ↗

Ends the round by discarding the oldest version of each planet's team array in favor of another version that is a round more recent.

(&mut self)

Source from the content-addressed store, hash-verified

98 /// Ends the round by discarding the oldest version of each planet's team
99 /// array in favor of another version that is a round more recent.
100 pub fn end_round(&mut self) {
101 let array = self.get_arrays(Planet::Earth).front().unwrap().clone();
102 self.get_arrays_mut(Planet::Earth).pop_back();
103 self.get_arrays_mut(Planet::Earth).push_front(array);
104
105 let array = self.get_arrays(Planet::Mars).front().unwrap().clone();
106 self.get_arrays_mut(Planet::Mars).pop_back();
107 self.get_arrays_mut(Planet::Mars).push_front(array);
108 }
109}
110
111#[cfg(test)]

Callers 1

Calls 3

cloneMethod · 0.80
get_arraysMethod · 0.80
get_arrays_mutMethod · 0.80

Tested by 1