Add random choose method in the Cardinal enum
This commit is contained in:
parent
d40dedfc17
commit
c6f4dbffe3
@ -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)];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user