diff options
Diffstat (limited to 'src/ch/epfl/maze/physical/Predator.java')
-rw-r--r-- | src/ch/epfl/maze/physical/Predator.java | 89 |
1 files changed, 42 insertions, 47 deletions
diff --git a/src/ch/epfl/maze/physical/Predator.java b/src/ch/epfl/maze/physical/Predator.java index 5aa3be2..8c340e8 100644 --- a/src/ch/epfl/maze/physical/Predator.java +++ b/src/ch/epfl/maze/physical/Predator.java | |||
@@ -5,55 +5,50 @@ import ch.epfl.maze.util.Vector2D; | |||
5 | 5 | ||
6 | /** | 6 | /** |
7 | * Predator that kills a prey when they meet with each other in the labyrinth. | 7 | * Predator that kills a prey when they meet with each other in the labyrinth. |
8 | * | ||
9 | */ | 8 | */ |
10 | 9 | ||
11 | abstract public class Predator extends Animal { | 10 | abstract public class Predator extends Animal { |
12 | 11 | ||
13 | /* constants relative to the Pac-Man game */ | 12 | /* constants relative to the Pac-Man game */ |
14 | public static final int SCATTER_DURATION = 14; | 13 | public static final int SCATTER_DURATION = 14; |
15 | public static final int CHASE_DURATION = 40; | 14 | public static final int CHASE_DURATION = 40; |
16 | 15 | ||
17 | /** | 16 | /** |
18 | * Constructs a predator with a specified position. | 17 | * Constructs a predator with a specified position. |
19 | * | 18 | * |
20 | * @param position | 19 | * @param position Position of the predator in the labyrinth |
21 | * Position of the predator in the labyrinth | 20 | */ |
22 | */ | 21 | |
23 | 22 | public Predator(Vector2D position) { | |
24 | public Predator(Vector2D position) { | 23 | super(position); |
25 | super(position); | 24 | // TODO |
26 | // TODO | 25 | } |
27 | } | 26 | |
28 | 27 | /** | |
29 | /** | 28 | * Moves according to a <i>random walk</i>, used while not hunting in a |
30 | * Moves according to a <i>random walk</i>, used while not hunting in a | 29 | * {@code MazeSimulation}. |
31 | * {@code MazeSimulation}. | 30 | */ |
32 | * | 31 | |
33 | */ | 32 | @Override |
34 | 33 | public final Direction move(Direction[] choices) { | |
35 | @Override | 34 | // TODO |
36 | public final Direction move(Direction[] choices) { | 35 | return Direction.NONE; |
37 | // TODO | 36 | } |
38 | return Direction.NONE; | 37 | |
39 | } | 38 | /** |
40 | 39 | * Retrieves the next direction of the animal, by selecting one choice among | |
41 | /** | 40 | * the ones available from its position. |
42 | * Retrieves the next direction of the animal, by selecting one choice among | 41 | * <p> |
43 | * the ones available from its position. | 42 | * In this variation, the animal knows the world entirely. It can therefore |
44 | * <p> | 43 | * use the position of other animals in the daedalus to hunt more |
45 | * In this variation, the animal knows the world entirely. It can therefore | 44 | * effectively. |
46 | * use the position of other animals in the daedalus to hunt more | 45 | * |
47 | * effectively. | 46 | * @param choices The choices left to the animal at its current position (see |
48 | * | 47 | * {@link ch.epfl.maze.physical.World#getChoices(Vector2D) |
49 | * @param choices | 48 | * World.getChoices(Vector2D)}) |
50 | * The choices left to the animal at its current position (see | 49 | * @param daedalus The world in which the animal moves |
51 | * {@link ch.epfl.maze.physical.World#getChoices(Vector2D) | 50 | * @return The next direction of the animal, chosen in {@code choices} |
52 | * World.getChoices(Vector2D)}) | 51 | */ |
53 | * @param daedalus | 52 | |
54 | * The world in which the animal moves | 53 | abstract public Direction move(Direction[] choices, Daedalus daedalus); |
55 | * @return The next direction of the animal, chosen in {@code choices} | ||
56 | */ | ||
57 | |||
58 | abstract public Direction move(Direction[] choices, Daedalus daedalus); | ||
59 | } | 54 | } |