Ok if the unit is a robot. Errors otherwise. InappropriateUnitType - the unit is not a robot.
(&self)
| 390 | /// |
| 391 | /// * InappropriateUnitType - the unit is not a robot. |
| 392 | pub(crate) fn ok_if_robot(&self) -> Result<(), GameError> { |
| 393 | if self.unit_type.is_robot() { |
| 394 | Ok(()) |
| 395 | } else { |
| 396 | Err(GameError::InappropriateUnitType)? |
| 397 | } |
| 398 | } |
| 399 | |
| 400 | /// Ok if the unit is a structure. Errors otherwise. |
| 401 | /// |
no test coverage detected