mirror of
				https://github.com/inf112-v20/Fiasko.git
				synced 2025-11-03 03:03:43 +01:00 
			
		
		
		
	removed the the update respawn location of the robot from the function
This commit is contained in:
		@@ -443,7 +443,7 @@ public class Board {
 | 
			
		||||
        Robot robot = robots.get(robotID);
 | 
			
		||||
        int flagNr = flagID.getTileTypeID() % 16;
 | 
			
		||||
        if (flagNr - 1 == robot.getLastFlagVisited()) {
 | 
			
		||||
            robot.setLastFlagVisitedAndUpdateBackupPosition(flagNr);
 | 
			
		||||
            robot.setLastFlagVisited(flagNr);
 | 
			
		||||
            setHasTouchedFlagThisTurnFromRobotID(robotID, true);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -117,12 +117,8 @@ public class Robot {
 | 
			
		||||
     *
 | 
			
		||||
     * @param currentFlag The flag the robot is standing on
 | 
			
		||||
     */
 | 
			
		||||
    public void setLastFlagVisitedAndUpdateBackupPosition(int currentFlag) {
 | 
			
		||||
        if (currentFlag - 1 != this.lastFlagVisited) {
 | 
			
		||||
            throw new IllegalArgumentException("The robot has not yet visited the previous flag!");
 | 
			
		||||
        }
 | 
			
		||||
    public void setLastFlagVisited(int currentFlag) {
 | 
			
		||||
        this.lastFlagVisited = currentFlag;
 | 
			
		||||
        this.backupPosition = currentPosition;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user