Moves this rocket and any location-based indexing to space. Must be on the current planet and team. Also moves all the units inside it.
(&mut self, rocket_id: UnitID)
| 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. |
| 878 | fn move_to_space(&mut self, rocket_id: UnitID) { |
| 879 | self.remove_unit(rocket_id); |
| 880 | |
| 881 | let rocket = self.my_planet_mut().units.remove(&rocket_id).expect("unit exists"); |
| 882 | for id in rocket.structure_garrison().expect("unit is a rocket") { |
| 883 | let unit = self.my_planet_mut().units.remove(&id).expect("unit exists"); |
| 884 | self.my_team_mut().units_in_space.insert(id, unit); |
| 885 | } |
| 886 | self.my_team_mut().units_in_space.insert(rocket_id, rocket); |
| 887 | } |
| 888 | |
| 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. |
no test coverage detected