The map location of the unit. UnitNotOnMap - The unit is in a garrison or in space, and does not have a map location.
(&self)
| 330 | /// * UnitNotOnMap - The unit is in a garrison or in space, and does not |
| 331 | /// have a map location. |
| 332 | pub fn map_location(&self) -> Result<MapLocation, GameError> { |
| 333 | match *self { |
| 334 | Location::OnMap(map_loc) => Ok(map_loc), |
| 335 | _ => Err(GameError::UnitNotOnMap)?, |
| 336 | } |
| 337 | } |
| 338 | |
| 339 | /// Whether the unit is in a garrison. |
| 340 | pub fn is_in_garrison(&self) -> bool { |
no outgoing calls