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

Method blueprint

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

Blueprints a unit of the given type in the given direction. Subtract cost of that unit from the team's resource pool. NoSuchUnit - the worker does not exist (within the vision range). TeamNotAllowed - the worker is not on the current player's team. InappropriateUnitType - the unit is not a worker, or the unit type is not a structure. Overheated - the worker has already performed an action this tu

(&mut self, worker_id: UnitID, structure_type: UnitType,
                     direction: Direction)

Source from the content-addressed store, hash-verified

654 /// * InsufficientKarbonite - your team does not have enough Karbonite to
655 /// build the requested structure.
656 pub fn blueprint(&mut self, worker_id: UnitID, structure_type: UnitType,
657 direction: Direction) -> Result<(), GameError> {
658 let delta = Delta::Blueprint { worker_id, structure_type, direction };
659 self.world.apply(&delta)?;
660 if self.config.generate_turn_messages {
661 self.turn.changes.push(delta);
662 }
663 Ok(())
664 }
665
666 /// Whether the worker can build a blueprint with the given ID. The worker
667 /// and the blueprint must be adjacent to each other. The worker cannot

Callers

nothing calls this directly

Calls 1

applyMethod · 0.80

Tested by

no test coverage detected