diff options
author | Pacien TRAN-GIRARD | 2015-11-21 10:44:42 +0100 |
---|---|---|
committer | Pacien TRAN-GIRARD | 2015-11-21 10:44:42 +0100 |
commit | 90bd766f361083f6fd9e39ff080c83fcc606832f (patch) | |
tree | df81a931c9565a4b227068680087f58fdace1859 /src/ch/epfl/maze/physical/Animal.java | |
parent | 655ac88f4e73b2df532a451aedf5a561ea1b0d2c (diff) | |
download | maze-solver-90bd766f361083f6fd9e39ff080c83fcc606832f.tar.gz |
Reformat imported code
Diffstat (limited to 'src/ch/epfl/maze/physical/Animal.java')
-rw-r--r-- | src/ch/epfl/maze/physical/Animal.java | 104 |
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 | ||
12 | abstract public class Animal { | 11 | abstract 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 | } |