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

View File

@ -150,7 +150,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

@ -463,9 +463,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) {
@ -486,4 +486,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);
}
}