summaryrefslogtreecommitdiff
path: root/src/ch/epfl/maze/physical/Animal.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/ch/epfl/maze/physical/Animal.java')
-rw-r--r--src/ch/epfl/maze/physical/Animal.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ch/epfl/maze/physical/Animal.java b/src/ch/epfl/maze/physical/Animal.java
index 04c4baf..e15cb74 100644
--- a/src/ch/epfl/maze/physical/Animal.java
+++ b/src/ch/epfl/maze/physical/Animal.java
@@ -47,8 +47,11 @@ abstract public class Animal {
47 * {@link ch.epfl.maze.physical.World#getChoices(Vector2D) 47 * {@link ch.epfl.maze.physical.World#getChoices(Vector2D)
48 * World.getChoices(Vector2D)}) 48 * World.getChoices(Vector2D)})
49 * @return The next direction of the animal, chosen in {@code choices} 49 * @return The next direction of the animal, chosen in {@code choices}
50 * @implNote Not abstract for compatibility purpose (in order not to break tests)
50 */ 51 */
51 abstract public Direction move(Set<Direction> choices); 52 public Direction move(Set<Direction> choices) {
53 return null;
54 }
52 55
53 /** 56 /**
54 * Retrieves the next direction of the animal, by selecting one choice among 57 * Retrieves the next direction of the animal, by selecting one choice among
@@ -58,8 +61,10 @@ abstract public class Animal {
58 * {@link ch.epfl.maze.physical.World#getChoices(Vector2D) 61 * {@link ch.epfl.maze.physical.World#getChoices(Vector2D)
59 * World.getChoices(Vector2D)}) 62 * World.getChoices(Vector2D)})
60 * @return The next direction of the animal, chosen in {@code choices} 63 * @return The next direction of the animal, chosen in {@code choices}
64 * @apiNote Not final for compatibility purpose (in order not to break tests)
65 * @deprecated Use @code{Direction move(Set<Direction> choices)} instead
61 */ 66 */
62 public final Direction move(Direction[] choices) { 67 public Direction move(Direction[] choices) {
63 return this.move(EnumSet.copyOf(Arrays.asList(choices))); 68 return this.move(EnumSet.copyOf(Arrays.asList(choices)));
64 } 69 }
65 70