Ok if unit has unlocked its ability. InappropriateUnitType - the unit is not a robot. ResearchNotUnlocked - the ability is not researched.
(&self)
| 601 | /// * InappropriateUnitType - the unit is not a robot. |
| 602 | /// * ResearchNotUnlocked - the ability is not researched. |
| 603 | pub(crate) fn ok_if_ability_unlocked(&self) -> Result<(), GameError> { |
| 604 | if !self.is_ability_unlocked()? { |
| 605 | Err(GameError::ResearchNotUnlocked { unit_type: self.unit_type() })? |
| 606 | } |
| 607 | Ok(()) |
| 608 | } |
| 609 | |
| 610 | /// Ok if unit can use its ability. The unit's ability heat must |
| 611 | /// be lower than the maximum heat to act. |
no test coverage detected