diff --git a/cicaprojekt/Direction.java b/cicaprojekt/Direction.java index c0bdc8e..fac7ffe 100644 --- a/cicaprojekt/Direction.java +++ b/cicaprojekt/Direction.java @@ -2,9 +2,21 @@ package cicaprojekt; import java.util.Random; +/** + * A játékban előforduló irányokat definiáló enumerátor. + */ public enum Direction { + /** + * Az irányok felsorolása. + */ NORTH, SOUTH, EAST, WEST; + /** + * A kapott irány megfordítottjával visszatérő függvény. + * + * @param direction a kapott irány + * @return az irány fordítottja + */ public static Direction invert(Direction direction) { switch (direction) { case NORTH: @@ -20,6 +32,11 @@ public enum Direction { } } + /** + * Egy véletlenszerű iránnyal tér vissza. + * + * @return véletlen irány + */ public static Direction getRandom() { return Direction.values()[new Random().nextInt(Direction.values().length)]; }