diff --git a/src/main/java/inf112/fiasko/roborally/objects/Robot.java b/src/main/java/inf112/fiasko/roborally/objects/Robot.java index 16e1fac..4082beb 100644 --- a/src/main/java/inf112/fiasko/roborally/objects/Robot.java +++ b/src/main/java/inf112/fiasko/roborally/objects/Robot.java @@ -16,6 +16,7 @@ public class Robot { private Position backupPosition; private Position currentPosition; private Direction facingDirection; + private boolean hasTouchedFlagThisTurn = false; /** * Instantiates a new robot @@ -29,6 +30,23 @@ public class Robot { this.facingDirection = Direction.NORTH; } + /** + * True if the robot has touched a flag in the current turn + * @return a boolean + */ + public boolean isHasTouchedFlagThisTurn() { + return hasTouchedFlagThisTurn; + } + + /** + * Sets the boolean value to true if the robot touches a flag during a turn, + * and false at the end of each turn. + * @param hasTouchedFlagThisTurn the boolean value to be set. + */ + public void setHasTouchedFlagThisTurn(boolean hasTouchedFlagThisTurn) { + this.hasTouchedFlagThisTurn = hasTouchedFlagThisTurn; + } + /** * Gets the damage the robot has taken * @return The amount of damage the robot has received