This commit is contained in:
2020-03-31 14:45:00 +02:00
3 changed files with 51 additions and 16 deletions

View File

@ -158,7 +158,7 @@ public class Board {
*/
public void repairRobotOnTile(RobotID robotID){
Robot robot = robots.get(robotID);
int newDamage =Math.max(robot.getDamageTaken()-1,0);
int newDamage = Math.max(robot.getDamageTaken()-1,0);
robot.setDamageTaken(newDamage);
}

View File

@ -414,9 +414,9 @@ public class RoboRallyGame implements IDrawableGame {
}
/**
* repair all robots standing on a reparer tile
* repair all robots standing on a repair tile
*/
private void repairAllRobotsOnReparerTiles(){
private void repairAllRobotsOnRepairTiles(){
List<BoardElementContainer<Tile>> listOfRepareTiles = gameBoard.getPositionsOfTileOnBoard(TileType.FLAG_1,
TileType.FLAG_2, TileType.FLAG_3, TileType.FLAG_4, TileType.WRENCH, TileType.WRENCH_AND_HAMMER);
for (BoardElementContainer<Tile> repareTile:listOfRepareTiles) {
@ -437,4 +437,13 @@ public class RoboRallyGame implements IDrawableGame {
player.setPowerDownNextRound(false);
}
}
/**
* sets the powerdown status of a robots
* @param player the player that owns the robot
* @param powerdownStatus the powerdown status
*/
private void setRobotPowerDown(Player player,Boolean powerdownStatus){
gameBoard.setPowerDown(player.getRobotID(),powerdownStatus);
}
}