diff options
author | Pacien TRAN-GIRARD | 2015-11-23 12:01:02 +0100 |
---|---|---|
committer | Pacien TRAN-GIRARD | 2015-11-23 12:01:02 +0100 |
commit | a842d134397747a0f72d2f70ca604c28784d05a3 (patch) | |
tree | 998d51101ad8a79bfdce9f51b07c0b1c90eeba04 /src/ch/epfl/maze/physical/GhostPredator.java | |
parent | 3bac5786bf9d14854d90843cb6bc7317afffc810 (diff) | |
download | maze-solver-a842d134397747a0f72d2f70ca604c28784d05a3.tar.gz |
Implement Clyde A.I.
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: |