Fixed selection bug and changed the astar a bit but its still not right

This commit is contained in:
Ziver Koc 2007-04-19 15:41:31 +00:00
parent bdb12e2000
commit 397fb7ebd0
4 changed files with 15 additions and 10 deletions

View file

@ -47,11 +47,12 @@ public class AStarPathfinder{
start.costFromStart = 0;
open.add(start);
AStarNode node = null;
// Go through all the items in the open storage.
int order = 0; // defines the order of which the nodes were visited (used in gui visuals)
while (!open.isEmpty()) {
// Let's retrieve the first item from the storage.
AStarNode node = (AStarNode) open.removeFirst();
node = (AStarNode) open.removeFirst();
node.setVisited(true);
node.setVisitOrder(order++);
@ -96,7 +97,8 @@ public class AStarPathfinder{
}
}
return null;
//return null;
return constructPath(node);
}