diff options
Diffstat (limited to 'src/ch/epfl/maze/physical/zoo/Monkey.java')
-rw-r--r-- | src/ch/epfl/maze/physical/zoo/Monkey.java | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/ch/epfl/maze/physical/zoo/Monkey.java b/src/ch/epfl/maze/physical/zoo/Monkey.java index 7bcf090..196b028 100644 --- a/src/ch/epfl/maze/physical/zoo/Monkey.java +++ b/src/ch/epfl/maze/physical/zoo/Monkey.java | |||
@@ -13,7 +13,6 @@ import java.util.List; | |||
13 | * | 13 | * |
14 | * @author Pacien TRAN-GIRARD | 14 | * @author Pacien TRAN-GIRARD |
15 | */ | 15 | */ |
16 | |||
17 | public class Monkey extends Animal { | 16 | public class Monkey extends Animal { |
18 | 17 | ||
19 | private Direction currentDirection; | 18 | private Direction currentDirection; |
@@ -23,7 +22,6 @@ public class Monkey extends Animal { | |||
23 | * | 22 | * |
24 | * @param position Starting position of the monkey in the labyrinth | 23 | * @param position Starting position of the monkey in the labyrinth |
25 | */ | 24 | */ |
26 | |||
27 | public Monkey(Vector2D position) { | 25 | public Monkey(Vector2D position) { |
28 | super(position); | 26 | super(position); |
29 | this.currentDirection = Direction.NONE; | 27 | this.currentDirection = Direction.NONE; |
@@ -35,7 +33,6 @@ public class Monkey extends Animal { | |||
35 | * @param choices An array of possible directions | 33 | * @param choices An array of possible directions |
36 | * @return The currentDirection to take according to the "left paw rule" | 34 | * @return The currentDirection to take according to the "left paw rule" |
37 | */ | 35 | */ |
38 | |||
39 | private Direction followLeft(Direction[] choices) { | 36 | private Direction followLeft(Direction[] choices) { |
40 | List<Direction> choiceList = new ArrayList<>(Arrays.asList(choices)); | 37 | List<Direction> choiceList = new ArrayList<>(Arrays.asList(choices)); |
41 | Direction dir = this.currentDirection.rotateLeft(); | 38 | Direction dir = this.currentDirection.rotateLeft(); |
@@ -60,7 +57,6 @@ public class Monkey extends Animal { | |||
60 | /** | 57 | /** |
61 | * Moves according to the relative left wall that the monkey has to follow. | 58 | * Moves according to the relative left wall that the monkey has to follow. |
62 | */ | 59 | */ |
63 | |||
64 | @Override | 60 | @Override |
65 | public Direction move(Direction[] choices) { | 61 | public Direction move(Direction[] choices) { |
66 | this.currentDirection = this.findDirection(choices); | 62 | this.currentDirection = this.findDirection(choices); |
@@ -71,4 +67,5 @@ public class Monkey extends Animal { | |||
71 | public Animal copy() { | 67 | public Animal copy() { |
72 | return new Monkey(this.getPosition()); | 68 | return new Monkey(this.getPosition()); |
73 | } | 69 | } |
70 | |||
74 | } | 71 | } |