summaryrefslogtreecommitdiff
path: root/src/ch/epfl/maze/physical/Predator.java
diff options
context:
space:
mode:
authorPacien TRAN-GIRARD2015-11-24 21:56:22 +0100
committerPacien TRAN-GIRARD2015-11-24 21:56:22 +0100
commitf312719bf9df140a22406a4e40c5221a86cd8073 (patch)
tree06af4c01044096b6d2a5578d4f6b166d77384e07 /src/ch/epfl/maze/physical/Predator.java
parentbe641348b8d677b3d9cdc0db90804edb0c46a3dc (diff)
downloadmaze-solver-f312719bf9df140a22406a4e40c5221a86cd8073.tar.gz
Refactor Daedalus residence
Diffstat (limited to 'src/ch/epfl/maze/physical/Predator.java')
-rw-r--r--src/ch/epfl/maze/physical/Predator.java46
1 files changed, 1 insertions, 45 deletions
diff --git a/src/ch/epfl/maze/physical/Predator.java b/src/ch/epfl/maze/physical/Predator.java
index ad5900e..9cc7256 100644
--- a/src/ch/epfl/maze/physical/Predator.java
+++ b/src/ch/epfl/maze/physical/Predator.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 * Predator that kills a prey when they meet with each other in the labyrinth. 6 * Predator that kills a prey when they meet with 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 Predator extends ProbabilisticAnimal { 11abstract public class Predator extends Animal implements DaedalusAware {
17 12
18 /** 13 /**
19 * Constructs a predator with a specified position. 14 * Constructs a predator with a specified position.
@@ -24,43 +19,4 @@ abstract public class Predator 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 hunt 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 hunt 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}