public PathNode(Point location, PathNode parent, int addg) {
        this.location = location;
        this.parent = parent;
        if (parent != null) {
            gscore = addg + parent.getGscore();
        }
    }