Loads the robot into the garrison of the structure. NoSuchUnit - either unit does not exist (inside the vision range). TeamNotAllowed - either unit is not on the current player's team. UnitNotOnMap - either unit is not on the map. Overheated - the robot is not ready to move again. InappropriateUnitType - the first unit is not a structure, or the second unit is not a robot. StructureNotYetBuilt -
(&mut self, structure_id: UnitID, robot_id: UnitID)
| 1786 | /// * GarrisonFull - the structure's garrison is already full. |
| 1787 | /// * OutOfRange - the robot is not adjacent to the structure. |
| 1788 | pub fn load(&mut self, structure_id: UnitID, robot_id: UnitID) |
| 1789 | -> Result<(), GameError> { |
| 1790 | self.ok_if_can_load(structure_id, robot_id)?; |
| 1791 | self.remove_unit(robot_id); |
| 1792 | self.my_unit_mut(structure_id).unwrap().load(robot_id); |
| 1793 | self.my_unit_mut(robot_id).unwrap().board_rocket(structure_id); |
| 1794 | Ok(()) |
| 1795 | } |
| 1796 | |
| 1797 | fn ok_if_can_unload(&self, structure_id: UnitID, direction: Direction) |
| 1798 | -> Result<(), GameError> { |
no test coverage detected