Moves this rocket and any location-based indexing from space to this planet. Must currently be in space. Also move all the units inside it.
(&mut self, rocket_id: UnitID)
| 889 | /// Moves this rocket and any location-based indexing from space to this |
| 890 | /// planet. Must currently be in space. Also move all the units inside it. |
| 891 | fn move_from_space(&mut self, rocket_id: UnitID) { |
| 892 | let rocket = self.my_team_mut().units_in_space.remove(&rocket_id).expect("unit exists"); |
| 893 | |
| 894 | for id in rocket.structure_garrison().expect("unit is a rocket") { |
| 895 | let unit = self.my_team_mut().units_in_space.remove(&id).expect("unit exists"); |
| 896 | self.my_planet_mut().units.insert(id, unit); |
| 897 | } |
| 898 | |
| 899 | self.my_planet_mut().units.insert(rocket_id, rocket); |
| 900 | self.place_unit(rocket_id); |
| 901 | } |
| 902 | |
| 903 | /// Inserts a new unit into the internal data structures of the game world, |
| 904 | /// assuming it is on the map. |
no test coverage detected