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/Animal.java | |
parent | 15ae5683367df9f32df301cfc66dcbe41d193208 (diff) | |
download | maze-solver-bda6db0eb45b4fb10d9644d9b7bf2699e17a0e5d.tar.gz |
Keep method compatibility for tests
Diffstat (limited to 'src/ch/epfl/maze/physical/Animal.java')
-rw-r--r-- | src/ch/epfl/maze/physical/Animal.java | 9 |
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 | ||