Add random choose method in the Cardinal enum

This commit is contained in:
Katchan 2021-12-02 20:00:53 +01:00
parent d40dedfc17
commit c6f4dbffe3

View File

@ -8,5 +8,11 @@ public enum Cardinal {
NORTH_EAST, NORTH_EAST,
NORTH_WEST, NORTH_WEST,
SOUTH_EAST, SOUTH_EAST,
SOUTH_WEST SOUTH_WEST;
public static Cardinal getRandom() {
return values()[(int) (Math.random() * values().length)];
} }
}