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

Method replicate

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

Replicates a worker in the given direction. Subtracts the cost of the worker 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. Overheated - the worker is not ready to replicate again. InsufficientKarbonite - your team does not have enoug

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

Source from the content-addressed store, hash-verified

742 /// * LocationNotEmpty - the location in the target direction is already
743 /// occupied.
744 pub fn replicate(&mut self, worker_id: UnitID, direction: Direction)
745 -> Result<(), GameError> {
746 let delta = Delta::Replicate { worker_id, direction };
747 self.world.apply(&delta)?;
748 if self.config.generate_turn_messages {
749 self.turn.changes.push(delta);
750 }
751 Ok(())
752 }
753
754 // ************************************************************************
755 // *************************** KNIGHT METHODS *****************************

Callers

nothing calls this directly

Calls 1

applyMethod · 0.80

Tested by

no test coverage detected