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

Method disintegrate_unit

battlecode-engine/src/world.rs:967–971  ·  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, id: UnitID)

Source from the content-addressed store, hash-verified

965 /// * NoSuchUnit - the unit does not exist (inside the vision range).
966 /// * TeamNotAllowed - the unit is not on the current player's team.
967 pub fn disintegrate_unit(&mut self, id: UnitID) -> Result<(), GameError> {
968 self.my_unit(id)?;
969 self.destroy_unit(id);
970 Ok(())
971 }
972
973 // ************************************************************************
974 // ************************* LOCATION METHODS *****************************

Callers 1

applyMethod · 0.45

Calls 2

my_unitMethod · 0.80
destroy_unitMethod · 0.80

Tested by

no test coverage detected