MCPcopy Index your code
hub / github.com/battlecode/battlecode-2018 / disintegrate_unit

Method disintegrate_unit

battlecode-engine/src/controller/mod.rs:472–479  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 *****************************

Callers

nothing calls this directly

Calls 1

applyMethod · 0.80

Tested by

no test coverage detected