Ok if the worker can perform a worker action (building, blueprinting, harvesting, or replicating). InappropriateUnitType - the unit is not a worker. Overheated - the worker is not ready to perform a worker action.
(&self)
| 673 | /// * InappropriateUnitType - the unit is not a worker. |
| 674 | /// * Overheated - the worker is not ready to perform a worker action. |
| 675 | pub(crate) fn ok_if_can_worker_act(&self) -> Result<(), GameError> { |
| 676 | if self.unit_type != Worker { |
| 677 | Err(GameError::InappropriateUnitType)?; |
| 678 | } |
| 679 | if self.has_worker_acted { |
| 680 | Err(GameError::Overheated)?; |
| 681 | } |
| 682 | Ok(()) |
| 683 | } |
| 684 | |
| 685 | /// Updates the unit as if it has performed a worker action. |
| 686 | pub(crate) fn worker_act(&mut self) { |
no outgoing calls
no test coverage detected