public abstract class AbstractPathfinderNode extends java.lang.Object implements java.lang.Comparable<AbstractPathfinderNode>
| Modifier and Type | Field and Description |
|---|---|
protected double |
g
Distance from the starting node to this node following the current path
|
protected double |
h
Estimated distance from this node to the destination node
|
protected RectCoordinates |
location
Used to give an x, y, and z position of the node in 3D space.
|
protected AbstractPathfinderNode |
parent
Holds the parent node that will help with following the path
|
| Constructor and Description |
|---|
AbstractPathfinderNode(int x,
int y,
int z)
Class constructor
|
AbstractPathfinderNode(RectCoordinates location)
Class constructor taking in pre-made RectCoordinates location.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(AbstractPathfinderNode another) |
double |
g()
Returns the distance from the node to the start node in the path
search taking the current path that reaches this node.
|
double |
h()
Returns the approximate distance from this node to the destination
node in the path search.
|
RectCoordinates |
location()
Returns the location of the node in the grid
|
AbstractPathfinderNode |
parent()
Gets the parent node of this node
|
void |
setG(double val) |
void |
setH(double val) |
void |
setParent(AbstractPathfinderNode par) |
protected RectCoordinates location
protected AbstractPathfinderNode parent
protected double g
protected double h
public AbstractPathfinderNode(int x,
int y,
int z)
x - the column the node is located in the gridy - the row the node is located in the gridz - the aisle the node is located in the gridpublic AbstractPathfinderNode(RectCoordinates location)
location - the index of the node in the gridpublic RectCoordinates location()
public AbstractPathfinderNode parent()
public void setParent(AbstractPathfinderNode par)
public double g()
public void setG(double val)
public double h()
public void setH(double val)
public int compareTo(AbstractPathfinderNode another)
compareTo in interface java.lang.Comparable<AbstractPathfinderNode>