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

Method end_round

battlecode-engine/src/research.rs:204–218  ·  view source on GitHub ↗

Updates the internal state of research as if another round has passed. If an upgrade has completed, returns the branch that was just upgraded, and continues work on the next upgrade in the queue. Otherwise returns None.

(&mut self)

Source from the content-addressed store, hash-verified

202 ///
203 /// Otherwise returns None.
204 pub(crate) fn end_round(&mut self) -> Option<Branch> {
205 if let Some(rounds_left) = self.rounds_left {
206 if rounds_left > 1 {
207 self.rounds_left = Some(rounds_left - 1);
208 return None;
209 }
210
211 let branch = self.queue.remove(0);
212 *self.get_level_mut(&branch) += 1;
213 self.reset_rounds_left();
214 Some(branch)
215 } else {
216 None
217 }
218 }
219}
220
221#[cfg(test)]

Callers 1

end_round_with_resetFunction · 0.45

Calls 2

get_level_mutMethod · 0.80
reset_rounds_leftMethod · 0.80

Tested by 1

end_round_with_resetFunction · 0.36