From dbb524a7c739e56233a0b8791e312bf17441a699 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Fri, 11 Oct 2019 12:33:13 -0300 Subject: [PATCH] Sort the destinations from the start Signed-off-by: Chris Cromer --- src/main/java/cl/cromer/azaraka/Canvas.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/cl/cromer/azaraka/Canvas.java b/src/main/java/cl/cromer/azaraka/Canvas.java index be5a466..9854c86 100644 --- a/src/main/java/cl/cromer/azaraka/Canvas.java +++ b/src/main/java/cl/cromer/azaraka/Canvas.java @@ -306,6 +306,8 @@ public class Canvas extends java.awt.Canvas implements Constants { player.getAi().addDestination(new State(key.getCell().getX(), key.getCell().getY(), State.Type.KEY, null, 0)); } + player.getAi().sortDestinations(); + Thread thread = new Thread(player.getAi()); thread.start(); aiThreads.put(player.getAi(), thread);