diff options
author | Pacien TRAN-GIRARD | 2015-11-24 15:03:04 +0100 |
---|---|---|
committer | Pacien TRAN-GIRARD | 2015-11-24 15:08:29 +0100 |
commit | bda6db0eb45b4fb10d9644d9b7bf2699e17a0e5d (patch) | |
tree | 3b362344ad734a1542d1a07348bd7463ebcbb28e /src/ch/epfl/maze/physical/Prey.java | |
parent | 15ae5683367df9f32df301cfc66dcbe41d193208 (diff) | |
download | maze-solver-bda6db0eb45b4fb10d9644d9b7bf2699e17a0e5d.tar.gz |
Keep method compatibility for tests
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 | ||