Added invert to Direction
This commit is contained in:
parent
595d5d6048
commit
d14ce39ee1
@ -2,4 +2,19 @@ package cicaprojekt;
|
|||||||
|
|
||||||
public enum Direction {
|
public enum Direction {
|
||||||
NORTH, SOUTH, EAST, WEST;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user