Disintegrates the unit and removes it from the map. If the unit is a factory or a rocket, also disintegrates any units garrisoned inside it. NoSuchUnit - the unit does not exist (inside the vision range). TeamNotAllowed - the unit is not on the current player's team.
(&mut self, unit_id: UnitID)
| 470 | /// * NoSuchUnit - the unit does not exist (inside the vision range). |
| 471 | /// * TeamNotAllowed - the unit is not on the current player's team. |
| 472 | pub fn disintegrate_unit(&mut self, unit_id: UnitID) -> Result<(), GameError> { |
| 473 | let delta = Delta::Disintegrate { unit_id }; |
| 474 | self.world.apply(&delta)?; |
| 475 | if self.config.generate_turn_messages { |
| 476 | self.turn.changes.push(delta); |
| 477 | } |
| 478 | Ok(()) |
| 479 | } |
| 480 | |
| 481 | // ************************************************************************ |
| 482 | // ************************* LOCATION METHODS ***************************** |