From a842d134397747a0f72d2f70ca604c28784d05a3 Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Mon, 23 Nov 2015 12:01:02 +0100 Subject: Implement Clyde A.I. --- src/ch/epfl/maze/physical/GhostPredator.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/ch/epfl/maze/physical/GhostPredator.java') 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 @@ -187,6 +187,15 @@ abstract public class GhostPredator extends Predator { return this.move(bestPaths); } + /** + * Returns the current Mode. + * + * @return The current Mode + */ + protected Mode getMode(Daedalus daedalus) { + return this.mode; + } + /** * Returns the position to target according to the current Mode. * @@ -194,7 +203,7 @@ abstract public class GhostPredator extends Predator { * @return The position to target */ protected Vector2D getTargetPosition(Daedalus daedalus) { - switch (this.mode) { + switch (this.getMode(daedalus)) { case CHASE: return this.getPreyTargetPosition(daedalus); case SCATTER: -- cgit v1.2.3