diff options
Diffstat (limited to 'src/ch/epfl/maze/physical/Prey.java')
-rw-r--r-- | src/ch/epfl/maze/physical/Prey.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ch/epfl/maze/physical/Prey.java b/src/ch/epfl/maze/physical/Prey.java index 3654807..ff760c5 100644 --- a/src/ch/epfl/maze/physical/Prey.java +++ b/src/ch/epfl/maze/physical/Prey.java | |||
@@ -37,8 +37,11 @@ abstract public class Prey 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 Prey 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 | ||