Added invert to Direction
This commit is contained in:
		@@ -2,4 +2,19 @@ package cicaprojekt;
 | 
			
		||||
 | 
			
		||||
public enum Direction {
 | 
			
		||||
    NORTH, SOUTH, EAST, WEST;
 | 
			
		||||
 | 
			
		||||
    public static Direction invert(Direction direction) {
 | 
			
		||||
        switch (direction) {
 | 
			
		||||
            case NORTH:
 | 
			
		||||
                return SOUTH;
 | 
			
		||||
            case EAST:
 | 
			
		||||
                return WEST;
 | 
			
		||||
            case SOUTH:
 | 
			
		||||
                return NORTH;
 | 
			
		||||
            case WEST:
 | 
			
		||||
                return EAST;
 | 
			
		||||
            default:
 | 
			
		||||
                return NORTH;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user