diff options
Diffstat (limited to 'src/ch/epfl/maze/physical/GhostPredator.java')
-rw-r--r-- | src/ch/epfl/maze/physical/GhostPredator.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/ch/epfl/maze/physical/GhostPredator.java b/src/ch/epfl/maze/physical/GhostPredator.java index 44bb1f6..8188c00 100644 --- a/src/ch/epfl/maze/physical/GhostPredator.java +++ b/src/ch/epfl/maze/physical/GhostPredator.java | |||
@@ -188,13 +188,22 @@ abstract public class GhostPredator extends Predator { | |||
188 | } | 188 | } |
189 | 189 | ||
190 | /** | 190 | /** |
191 | * Returns the current Mode. | ||
192 | * | ||
193 | * @return The current Mode | ||
194 | */ | ||
195 | protected Mode getMode(Daedalus daedalus) { | ||
196 | return this.mode; | ||
197 | } | ||
198 | |||
199 | /** | ||
191 | * Returns the position to target according to the current Mode. | 200 | * Returns the position to target according to the current Mode. |
192 | * | 201 | * |
193 | * @param daedalus The Daedalus | 202 | * @param daedalus The Daedalus |
194 | * @return The position to target | 203 | * @return The position to target |
195 | */ | 204 | */ |
196 | protected Vector2D getTargetPosition(Daedalus daedalus) { | 205 | protected Vector2D getTargetPosition(Daedalus daedalus) { |
197 | switch (this.mode) { | 206 | switch (this.getMode(daedalus)) { |
198 | case CHASE: | 207 | case CHASE: |
199 | return this.getPreyTargetPosition(daedalus); | 208 | return this.getPreyTargetPosition(daedalus); |
200 | case SCATTER: | 209 | case SCATTER: |