Files
SAE31_2024/TestV1/src/fr/monkhanny/dorfromantik/enums/TileOrientation.java

26 lines
594 B
Java
Raw Normal View History

2024-11-14 19:21:56 +01:00
package fr.monkhanny.dorfromantik.enums;
public enum TileOrientation {
NORTH, NORTH_EAST, SOUTH_EAST, SOUTH, SOUTH_WEST, NORTH_WEST;
public TileOrientation oppositeOrientation() {
switch (this) {
case NORTH:
return SOUTH;
case NORTH_EAST:
return SOUTH_WEST;
case SOUTH_EAST:
return NORTH_WEST;
case SOUTH:
return NORTH;
case SOUTH_WEST:
return NORTH_EAST;
case NORTH_WEST:
return SOUTH_EAST;
default:
throw new IllegalArgumentException("Unknown TileOrientation: " + this);
}
}
}