Lager hjelpemetoder for å sjekke roboter via board

This commit is contained in:
GabrielMagnus 2020-04-16 12:34:54 +02:00
parent f46d2f4e29
commit d8167ba250

View File

@ -756,4 +756,31 @@ public class Board {
particles.setElement(positionX, positionY, new Particle(type, laserDirection));
}
/**
* Gets the int corresponding to the flag a robot has last visited
* @param robotID The robot to be checked
* @return The flag last visited in a number
*/
public int getLastFlagVisitedFromRobotID(RobotID robotID) {
return robots.get(robotID).getLastFlagVisited();
}
/**
* Sets a boolean for if the robot has touched a flag this turn
* @param robotID The robot to be checked
* @param hasTouched If the robot has touched a flag this turn
*/
public void setHasTouchedFlagThisTurnFromRobotID(RobotID robotID, boolean hasTouched) {
robots.get(robotID).setHasTouchedFlagThisTurn(hasTouched);
}
/**
* Checks a boolean for if the robot has touched a flag this turn
* @param robotID The robot to be checked
* @return If the robot has touched a flag this turn
*/
public boolean isHasTouchedFlagThisTurnFromRobotID(RobotID robotID) {
return robots.get(robotID).isHasTouchedFlagThisTurn();
}
}