summaryrefslogtreecommitdiff
path: root/src/ch/epfl/maze/physical/Predator.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/ch/epfl/maze/physical/Predator.java')
-rw-r--r--src/ch/epfl/maze/physical/Predator.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ch/epfl/maze/physical/Predator.java b/src/ch/epfl/maze/physical/Predator.java
index 5f0a3bb..ad5900e 100644
--- a/src/ch/epfl/maze/physical/Predator.java
+++ b/src/ch/epfl/maze/physical/Predator.java
@@ -37,8 +37,11 @@ abstract public class Predator extends ProbabilisticAnimal {
37 * World.getChoices(Vector2D)}) 37 * World.getChoices(Vector2D)})
38 * @param daedalus The world in which the animal moves 38 * @param daedalus The world in which the animal moves
39 * @return The next direction of the animal, chosen in {@code choices} 39 * @return The next direction of the animal, chosen in {@code choices}
40 * @implNote Not abstract for compatibility purpose (in order not to break tests)
40 */ 41 */
41 abstract public Direction move(Set<Direction> choices, Daedalus daedalus); 42 public Direction move(Set<Direction> choices, Daedalus daedalus) {
43 return null;
44 }
42 45
43 /** 46 /**
44 * Retrieves the next direction of the animal, by selecting one choice among 47 * Retrieves the next direction of the animal, by selecting one choice among
@@ -53,8 +56,10 @@ abstract public class Predator extends ProbabilisticAnimal {
53 * World.getChoices(Vector2D)}) 56 * World.getChoices(Vector2D)})
54 * @param daedalus The world in which the animal moves 57 * @param daedalus The world in which the animal moves
55 * @return The next direction of the animal, chosen in {@code choices} 58 * @return The next direction of the animal, chosen in {@code choices}
59 * @apiNote Not final for compatibility purpose (in order not to break tests)
60 * @deprecated Use @code{Direction move(Set<Direction> choices, Daedalus daedalus)} instead
56 */ 61 */
57 public final Direction move(Direction[] choices, Daedalus daedalus) { 62 public Direction move(Direction[] choices, Daedalus daedalus) {
58 return this.move(EnumSet.copyOf(Arrays.asList(choices)), daedalus); 63 return this.move(EnumSet.copyOf(Arrays.asList(choices)), daedalus);
59 } 64 }
60 65