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