Commands the worker to repair a structure, repleneshing health to it. This can only be done to structures which have been fully built. 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 target is not a structure. Ov
(&mut self, worker_id: UnitID, structure_id: UnitID)
| 711 | /// * OutOfRange - the worker is not adjacent to the structure. |
| 712 | /// * StructureNotYetBuilt - the structure has not been completed. |
| 713 | pub fn repair(&mut self, worker_id: UnitID, structure_id: UnitID) -> Result<(), GameError> { |
| 714 | let delta = Delta::Repair { worker_id, structure_id }; |
| 715 | self.world.apply(&delta)?; |
| 716 | if self.config.generate_turn_messages { |
| 717 | self.turn.changes.push(delta); |
| 718 | } |
| 719 | Ok(()) |
| 720 | } |
| 721 | |
| 722 | /// Whether the worker is ready to replicate. Tests that the worker's |
| 723 | /// ability heat is sufficiently low, that the team has sufficient |