From d8167ba250844315059879ec4b7702d4bb444613 Mon Sep 17 00:00:00 2001 From: GabrielMagnus Date: Thu, 16 Apr 2020 12:34:54 +0200 Subject: [PATCH] =?UTF-8?q?Lager=20hjelpemetoder=20for=20=C3=A5=20sjekke?= =?UTF-8?q?=20roboter=20via=20board?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fiasko/roborally/objects/Board.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/main/java/inf112/fiasko/roborally/objects/Board.java b/src/main/java/inf112/fiasko/roborally/objects/Board.java index 75d85b0..4dad6af 100644 --- a/src/main/java/inf112/fiasko/roborally/objects/Board.java +++ b/src/main/java/inf112/fiasko/roborally/objects/Board.java @@ -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(); + } + } \ No newline at end of file