mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-02-01 07:39:35 +01:00
Merge branch 'master' of https://github.com/inf112-v20/Fiasko
This commit is contained in:
commit
22f91c84c2
@ -140,7 +140,7 @@ public class Board {
|
|||||||
* @param robotID The robot id of the robot
|
* @param robotID The robot id of the robot
|
||||||
* @param powerdown The status of the powerdown
|
* @param powerdown The status of the powerdown
|
||||||
*/
|
*/
|
||||||
public void setPowerDown(RobotID robotID,Boolean powerdown){
|
public void setPowerDown(RobotID robotID, Boolean powerdown) {
|
||||||
robots.get(robotID).setPowerDown(powerdown);
|
robots.get(robotID).setPowerDown(powerdown);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -148,26 +148,26 @@ public class Board {
|
|||||||
* Gets the power down status of the robot
|
* Gets the power down status of the robot
|
||||||
* @param robotID The robot id of the robot
|
* @param robotID The robot id of the robot
|
||||||
*/
|
*/
|
||||||
public void getPowerDown(RobotID robotID) {
|
public boolean getPowerDown(RobotID robotID) {
|
||||||
robots.get(robotID).isInPowerDown();
|
return robots.get(robotID).isInPowerDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* removes one damage for a given robot given that it has taken som damage before
|
* removes one damage for a given robot given that it has taken som damage before
|
||||||
* @param robotID the ID of the robot
|
* @param robotID the ID of the robot
|
||||||
*/
|
*/
|
||||||
public void repairRobotOnTile(RobotID robotID){
|
public void repairRobotOnTile(RobotID robotID) {
|
||||||
Robot robot = robots.get(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);
|
robot.setDamageTaken(newDamage);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* sets the damage taken of robots in powerdown to 0
|
* sets the damage taken of robots in powerdown to 0
|
||||||
*/
|
*/
|
||||||
public void executePowerdown(){
|
public void executePowerdown() {
|
||||||
for (Robot robot:robots.values()) {
|
for (Robot robot:robots.values()) {
|
||||||
if(robot.isInPowerDown()){
|
if (robot.isInPowerDown()) {
|
||||||
robot.setDamageTaken(0);
|
robot.setDamageTaken(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user