package astar; import java.awt.Point; import java.util.LinkedList; public class AStarNode implements Comparable { public boolean passable; private QuadTree parent; public LinkedList neighbors; public int G; public int H; public AStarNode prev; public int curList; public int openListPos; public AStarNode(final QuadTree parent) { this.passable = true; this.parent = parent; this.G = -1; this.H = -1; this.curList = 0; } public QuadTree getParent() { return this.parent; } public int getF() { return this.G + this.H; } public Point getMidpoint() { return new Point(this.parent.getX() + this.parent.getWidth() / 2, this.parent.getY() + this.parent.getHeight() / 2); } @Override public int compareTo(final AStarNode o) { return this.getF() - o.getF(); } }