Get the asteroid strike at the given round. NullValue - There is no asteroid strike at this round.
(&self, round: Rounds)
| 528 | /// |
| 529 | /// * NullValue - There is no asteroid strike at this round. |
| 530 | pub fn asteroid(&self, round: Rounds) -> Result<&AsteroidStrike, GameError> { |
| 531 | if let Some(asteroid) = self.pattern.get(&round) { |
| 532 | Ok(asteroid) |
| 533 | } else { |
| 534 | Err(GameError::NullValue)? |
| 535 | } |
| 536 | } |
| 537 | |
| 538 | /// Get a map of round numbers to asteroid strikes. |
| 539 | pub fn asteroid_map(&self) -> FnvHashMap<Rounds, AsteroidStrike> { |