Ok if the robot can use its ability on the target location. InappropriateUnitType - the unit is not a robot. OutOfRange - the target location is not in range.
(&self, target_loc: Location)
| 624 | /// * InappropriateUnitType - the unit is not a robot. |
| 625 | /// * OutOfRange - the target location is not in range. |
| 626 | pub(crate) fn ok_if_within_ability_range(&self, target_loc: Location) -> Result<(), GameError> { |
| 627 | if !self.location().is_within_range(self.ability_range()?, target_loc) { |
| 628 | Err(GameError::OutOfRange)?; |
| 629 | } |
| 630 | Ok(()) |
| 631 | } |
| 632 | |
| 633 | // ************************************************************************ |
| 634 | // *************************** WORKER METHODS ***************************** |
no test coverage detected