Ok if unit can use its ability. The unit's ability heat must be lower than the maximum heat to act. InappropriateUnitType - the unit is not a robot. Overheated - the unit is not ready to use its ability.
(&self)
| 613 | /// * InappropriateUnitType - the unit is not a robot. |
| 614 | /// * Overheated - the unit is not ready to use its ability. |
| 615 | pub(crate) fn ok_if_ability_ready(&self) -> Result<(), GameError> { |
| 616 | if self.ability_heat()? >= MAX_HEAT_TO_ACT { |
| 617 | Err(GameError::Overheated)?; |
| 618 | } |
| 619 | Ok(()) |
| 620 | } |
| 621 | |
| 622 | /// Ok if the robot can use its ability on the target location. |
| 623 | /// |
no test coverage detected