summaryrefslogtreecommitdiff
path: root/src/ch/epfl/maze/physical/Animal.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/ch/epfl/maze/physical/Animal.java')
-rw-r--r--src/ch/epfl/maze/physical/Animal.java104
1 files changed, 50 insertions, 54 deletions
diff --git a/src/ch/epfl/maze/physical/Animal.java b/src/ch/epfl/maze/physical/Animal.java
index 8749f61..ebe389f 100644
--- a/src/ch/epfl/maze/physical/Animal.java
+++ b/src/ch/epfl/maze/physical/Animal.java
@@ -6,72 +6,68 @@ import ch.epfl.maze.util.Vector2D;
6/** 6/**
7 * Animal inside a {@code World} that can move depending on the available 7 * Animal inside a {@code World} that can move depending on the available
8 * choices it has at its position. 8 * choices it has at its position.
9 *
10 */ 9 */
11 10
12abstract public class Animal { 11abstract public class Animal {
13 12
14 /** 13 /**
15 * Constructs an animal with a specified position. 14 * Constructs an animal with a specified position.
16 * 15 *
17 * @param position 16 * @param position Position of the animal in the labyrinth
18 * Position of the animal in the labyrinth 17 */
19 */
20 18
21 public Animal(Vector2D position) { 19 public Animal(Vector2D position) {
22 // TODO 20 // TODO
23 } 21 }
24 22
25 /** 23 /**
26 * Retrieves the next direction of the animal, by selecting one choice among 24 * Retrieves the next direction of the animal, by selecting one choice among
27 * the ones available from its position. 25 * the ones available from its position.
28 * 26 *
29 * @param choices 27 * @param choices The choices left to the animal at its current position (see
30 * The choices left to the animal at its current position (see 28 * {@link ch.epfl.maze.physical.World#getChoices(Vector2D)
31 * {@link ch.epfl.maze.physical.World#getChoices(Vector2D) 29 * World.getChoices(Vector2D)})
32 * World.getChoices(Vector2D)}) 30 * @return The next direction of the animal, chosen in {@code choices}
33 * @return The next direction of the animal, chosen in {@code choices} 31 */
34 */
35 32
36 abstract public Direction move(Direction[] choices); 33 abstract public Direction move(Direction[] choices);
37 34
38 /** 35 /**
39 * Updates the animal position with a direction. 36 * Updates the animal position with a direction.
40 * <p> 37 * <p>
41 * <b>Note</b> : Do not call this function in {@code move(Direction[] 38 * <b>Note</b> : Do not call this function in {@code move(Direction[]
42 * choices)} ! 39 * choices)} !
43 * 40 *
44 * @param dir 41 * @param dir Direction that the animal has taken
45 * Direction that the animal has taken 42 */
46 */
47 43
48 public final void update(Direction dir) { 44 public final void update(Direction dir) {
49 // TODO 45 // TODO
50 } 46 }
51 47
52 /** 48 /**
53 * Sets new position for Animal. 49 * Sets new position for Animal.
54 * <p> 50 * <p>
55 * <b>Note</b> : Do not call this function in {@code move(Direction[] 51 * <b>Note</b> : Do not call this function in {@code move(Direction[]
56 * choices)} ! 52 * choices)} !
57 * 53 *
58 * @param position 54 * @param position
59 */ 55 */
60 56
61 public final void setPosition(Vector2D position) { 57 public final void setPosition(Vector2D position) {
62 // TODO 58 // TODO
63 } 59 }
64 60
65 /** 61 /**
66 * Returns position vector of animal. 62 * Returns position vector of animal.
67 * 63 *
68 * @return Current position of animal. 64 * @return Current position of animal.
69 */ 65 */
70 66
71 public final Vector2D getPosition() { 67 public final Vector2D getPosition() {
72 // TODO 68 // TODO
73 return null; 69 return null;
74 } 70 }
75 71
76 abstract public Animal copy(); 72 abstract public Animal copy();
77} 73}