From 655ac88f4e73b2df532a451aedf5a561ea1b0d2c Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Sat, 21 Nov 2015 10:36:18 +0100 Subject: Import project structure --- src/ch/epfl/maze/physical/Predator.java | 59 +++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 src/ch/epfl/maze/physical/Predator.java (limited to 'src/ch/epfl/maze/physical/Predator.java') 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 @@ +package ch.epfl.maze.physical; + +import ch.epfl.maze.util.Direction; +import ch.epfl.maze.util.Vector2D; + +/** + * Predator that kills a prey when they meet with each other in the labyrinth. + * + */ + +abstract public class Predator extends Animal { + + /* constants relative to the Pac-Man game */ + public static final int SCATTER_DURATION = 14; + public static final int CHASE_DURATION = 40; + + /** + * Constructs a predator with a specified position. + * + * @param position + * Position of the predator in the labyrinth + */ + + public Predator(Vector2D position) { + super(position); + // TODO + } + + /** + * Moves according to a random walk, used while not hunting in a + * {@code MazeSimulation}. + * + */ + + @Override + public final Direction move(Direction[] choices) { + // TODO + return Direction.NONE; + } + + /** + * Retrieves the next direction of the animal, by selecting one choice among + * the ones available from its position. + *
+ * In this variation, the animal knows the world entirely. It can therefore + * use the position of other animals in the daedalus to hunt more + * effectively. + * + * @param choices + * The choices left to the animal at its current position (see + * {@link ch.epfl.maze.physical.World#getChoices(Vector2D) + * World.getChoices(Vector2D)}) + * @param daedalus + * The world in which the animal moves + * @return The next direction of the animal, chosen in {@code choices} + */ + + abstract public Direction move(Direction[] choices, Daedalus daedalus); +} -- cgit v1.2.3