(&self, structure_id: UnitID, robot_id: UnitID)
| 1754 | // ************************************************************************ |
| 1755 | |
| 1756 | fn ok_if_can_load(&self, structure_id: UnitID, robot_id: UnitID) |
| 1757 | -> Result<(), GameError> { |
| 1758 | let robot = self.my_unit(robot_id)?; |
| 1759 | let structure = self.my_unit(structure_id)?; |
| 1760 | robot.ok_if_on_map()?; |
| 1761 | structure.ok_if_on_map()?; |
| 1762 | robot.ok_if_move_ready()?; |
| 1763 | structure.ok_if_can_load()?; |
| 1764 | if !structure.location().is_adjacent_to(robot.location()) { |
| 1765 | Err(GameError::OutOfRange)?; |
| 1766 | } |
| 1767 | Ok(()) |
| 1768 | } |
| 1769 | |
| 1770 | /// Whether the robot can be loaded into the given structure's garrison. The robot |
| 1771 | /// must be ready to move and must be adjacent to the structure. The structure |
no test coverage detected