Merge remote-tracking branch 'origin/master'

This commit is contained in:
Felix Cravic 2020-04-28 23:39:09 +02:00
commit 93f1b240da

View File

@ -10,4 +10,23 @@ public enum Direction {
public static final Direction[] HORIZONTAL = { SOUTH, WEST, NORTH, EAST };
public Direction opposite() {
switch (this) {
case UP:
return DOWN;
case DOWN:
return UP;
case EAST:
return WEST;
case WEST:
return EAST;
case NORTH:
return SOUTH;
case SOUTH:
return NORTH;
default:
throw new IllegalArgumentException();
}
}
}