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