Sets the number of rounds left to the cost of the first thing in the queue. Sets the cost to None if the queue is empty.
(&mut self)
| 150 | /// Sets the number of rounds left to the cost of the first thing in the |
| 151 | /// queue. Sets the cost to None if the queue is empty. |
| 152 | fn reset_rounds_left(&mut self) { |
| 153 | if self.queue.len() == 0 { |
| 154 | self.rounds_left = None; |
| 155 | return; |
| 156 | } |
| 157 | |
| 158 | let branch = &self.queue[0]; |
| 159 | let level = self.get_level(branch) + 1; |
| 160 | if let Ok(cost) = cost_of(branch, level) { |
| 161 | self.rounds_left = Some(cost); |
| 162 | } else { |
| 163 | unreachable!(); |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | /// Resets the research queue to be empty. Returns true if the queue was |
| 168 | /// not empty before, and false otherwise. |
no test coverage detected