Ok if the unit is a structure. Errors otherwise. InappropriateUnitType - the unit is not a structure.
(&self)
| 401 | /// |
| 402 | /// * InappropriateUnitType - the unit is not a structure. |
| 403 | pub(crate) fn ok_if_structure(&self) -> Result<(), GameError> { |
| 404 | if self.unit_type.is_structure() { |
| 405 | Ok(()) |
| 406 | } else { |
| 407 | Err(GameError::InappropriateUnitType)? |
| 408 | } |
| 409 | } |
| 410 | |
| 411 | /// Ok if the unit is the given type. Errors otherwise. |
| 412 | /// |
no test coverage detected