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)
| 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)] |