mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-01-31 23:29:36 +01:00
Lager hjelpemetoder for å sjekke roboter via board
This commit is contained in:
parent
f46d2f4e29
commit
d8167ba250
@ -756,4 +756,31 @@ public class Board {
|
|||||||
particles.setElement(positionX, positionY, new Particle(type, laserDirection));
|
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();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user