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

Method build

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

Builds a given blueprint, increasing its health by the worker's build amount. If raised to maximum health, the blueprint becomes a completed structure. NoSuchUnit - either unit does not exist (within the vision range). TeamNotAllowed - either unit is not on the current player's team. UnitNotOnMap - the worker is not on the map. InappropriateUnitType - the unit is not a worker, or the blueprint is

(&mut self, worker_id: UnitID, blueprint_id: UnitID)

Source from the content-addressed store, hash-verified

683 /// * OutOfRange - the worker is not adjacent to the blueprint.
684 /// * StructureAlreadyBuilt - the blueprint has already been completed.
685 pub fn build(&mut self, worker_id: UnitID, blueprint_id: UnitID)
686 -> Result<(), GameError> {
687 let delta = Delta::Build { worker_id, blueprint_id };
688 self.world.apply(&delta)?;
689 if self.config.generate_turn_messages {
690 self.turn.changes.push(delta);
691 }
692 Ok(())
693 }
694
695 /// Whether the given worker can repair the given strucutre. Tests that the worker
696 /// is able to execute a worker action, that the structure is built, and that the

Callers

nothing calls this directly

Calls 1

applyMethod · 0.80

Tested by

no test coverage detected