Whether the location is clear for a unit to occupy, either by movement or by construction. LocationOffMap - the location is off the map. LocationNotVisible - the location is outside the vision range.
(&self, location: MapLocation)
| 980 | /// * LocationOffMap - the location is off the map. |
| 981 | /// * LocationNotVisible - the location is outside the vision range. |
| 982 | pub fn is_occupiable(&self, location: MapLocation) -> Result<bool, GameError> { |
| 983 | self.ok_if_can_sense_location(location)?; |
| 984 | |
| 985 | let planet_map = &self.starting_map(location.planet); |
| 986 | Ok(planet_map.is_passable_terrain_at(location).unwrap() && |
| 987 | !self.my_planet().units_by_loc.contains_key(&location)) |
| 988 | } |
| 989 | |
| 990 | /// * NoSuchUnit - the robot does not exist (within the vision range). |
| 991 | /// * TeamNotAllowed - the robot is not on the current player's team. |
no test coverage detected