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