Returns OK if the structure can unload a unit. The structure must be on a planet and it must have at least one unit to unload. Does not check whether the unit is ready to move. InappropriateUnitType - the unit is not a structure. StructureNotYetBuilt - the structure has not yet been built. GarrisonEmpty - the unit's garrison is already empty.
(&self)
| 974 | /// * StructureNotYetBuilt - the structure has not yet been built. |
| 975 | /// * GarrisonEmpty - the unit's garrison is already empty. |
| 976 | pub(crate) fn ok_if_can_unload_unit(&self) -> Result<(), GameError> { |
| 977 | self.ok_if_structure_built()?; |
| 978 | if self.garrison.len() == 0 { |
| 979 | Err(GameError::GarrisonEmpty)?; |
| 980 | } |
| 981 | Ok(()) |
| 982 | } |
| 983 | |
| 984 | /// Updates the structure as if it has unloaded a single unit from the |
| 985 | /// structure, returning the unit ID. |
no test coverage detected