From 2e947589be5019e486dee7ea792407039db19252 Mon Sep 17 00:00:00 2001 From: Yorick Date: Thu, 9 Apr 2015 00:56:42 +0200 Subject: [PATCH] merge --- Applicatie/Visitor.java | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Applicatie/Visitor.java b/Applicatie/Visitor.java index 8e6c557..c69d4e0 100644 --- a/Applicatie/Visitor.java +++ b/Applicatie/Visitor.java @@ -158,10 +158,10 @@ public class Visitor for (Map.Entry e : options.entrySet()) { -// System.out.println("KEY: " + e.getKey()); + // System.out.println("KEY: " + e.getKey()); for (int i : e.getValue()) { -// System.out.println("VAL: " + i); + // System.out.println("VAL: " + i); if (finalTarget != target) { if (finalTarget == i && e.getKey() == target) @@ -171,19 +171,26 @@ public class Visitor } else if (finalTarget == i) { - target = e.getKey(); + target = getNextWaypoint(options, e.getKey()); break; } } } - System.out.println("--------------"); } } } - - public int getNextWaypoint() + + public int getNextWaypoint(HashMap options, int lastWaypoint) { - return 0; + Iterator it = options.keySet().iterator(); + for (int i : options.get(lastWaypoint)) + { + while (it.hasNext()) + { + System.out.println(it.next()); + } + } + return lastWaypoint; } public boolean checkIfOnWaypoint(Panel panel)