Temporarily removes this unit from any location-based indexing. Must be on the current planet and team before being removed.
(&mut self, id: UnitID)
| 863 | /// Temporarily removes this unit from any location-based indexing. |
| 864 | /// Must be on the current planet and team before being removed. |
| 865 | fn remove_unit(&mut self, id: UnitID) { |
| 866 | match self.my_unit(id) |
| 867 | .expect("Unit does not exist and cannot be removed.") |
| 868 | .location() { |
| 869 | OnMap(loc) => { |
| 870 | self.my_planet_mut().units_by_loc.remove(&loc); |
| 871 | }, |
| 872 | _ => panic!("Unit is not on a map and cannot be removed."), |
| 873 | } |
| 874 | } |
| 875 | |
| 876 | /// Moves this rocket and any location-based indexing to space. Must be |
| 877 | /// on the current planet and team. Also moves all the units inside it. |
no test coverage detected