summaryrefslogtreecommitdiff
path: root/src/ch/epfl/maze/physical/Prey.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/ch/epfl/maze/physical/Prey.java')
-rw-r--r--src/ch/epfl/maze/physical/Prey.java46
1 files changed, 1 insertions, 45 deletions
diff --git a/src/ch/epfl/maze/physical/Prey.java b/src/ch/epfl/maze/physical/Prey.java
index ff760c5..0ad62ff 100644
--- a/src/ch/epfl/maze/physical/Prey.java
+++ b/src/ch/epfl/maze/physical/Prey.java
@@ -1,19 +1,14 @@
1package ch.epfl.maze.physical; 1package ch.epfl.maze.physical;
2 2
3import ch.epfl.maze.util.Direction;
4import ch.epfl.maze.util.Vector2D; 3import ch.epfl.maze.util.Vector2D;
5 4
6import java.util.Arrays;
7import java.util.EnumSet;
8import java.util.Set;
9
10/** 5/**
11 * Prey that is killed by a predator when they meet each other in the labyrinth. 6 * Prey that is killed by a predator when they meet each other in the labyrinth.
12 * 7 *
13 * @author EPFL 8 * @author EPFL
14 * @author Pacien TRAN-GIRARD 9 * @author Pacien TRAN-GIRARD
15 */ 10 */
16abstract public class Prey extends ProbabilisticAnimal { 11abstract public class Prey extends Animal implements DaedalusAware {
17 12
18 /** 13 /**
19 * Constructs a prey with a specified position. 14 * Constructs a prey with a specified position.
@@ -24,43 +19,4 @@ abstract public class Prey extends ProbabilisticAnimal {
24 super(position); 19 super(position);
25 } 20 }
26 21
27 /**
28 * Retrieves the next direction of the animal, by selecting one choice among
29 * the ones available from its position.
30 * <p>
31 * In this variation, the animal knows the world entirely. It can therefore
32 * use the position of other animals in the daedalus to evade predators more
33 * effectively.
34 *
35 * @param choices The choices left to the animal at its current position (see
36 * {@link ch.epfl.maze.physical.World#getChoices(Vector2D)
37 * World.getChoices(Vector2D)})
38 * @param daedalus The world in which the animal moves
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)
41 */
42 public Direction move(Set<Direction> choices, Daedalus daedalus) {
43 return null;
44 }
45
46 /**
47 * Retrieves the next direction of the animal, by selecting one choice among
48 * the ones available from its position.
49 * <p>
50 * In this variation, the animal knows the world entirely. It can therefore
51 * use the position of other animals in the daedalus to evade predators more
52 * effectively.
53 *
54 * @param choices The choices left to the animal at its current position (see
55 * {@link ch.epfl.maze.physical.World#getChoices(Vector2D)
56 * World.getChoices(Vector2D)})
57 * @param daedalus The world in which the animal moves
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
61 */
62 public Direction move(Direction[] choices, Daedalus daedalus) {
63 return this.move(EnumSet.copyOf(Arrays.asList(choices)), daedalus);
64 }
65
66} 22}