Class AStarNode
java.lang.Object
de.gurkenlabs.litiengine.entities.behavior.AStarNode
public class AStarNode
extends java.lang.Object
Constructor Summary
Constructors Constructor Description AStarNode(boolean walkable, java.awt.Rectangle bound, int gridX, int gridY)
Method Summary
Modifier and Type Method Description void
clear()
Clears the assigned costs and the predecessor.java.awt.Rectangle
getBounds()
double
getCosts(AStarNode target)
double
getFCost()
Gets the total costs for this node.double
getGCost()
Gets the costs so far for this node.int
getGridX()
int
getGridY()
double
getHCost()
Gets the estimated costs for this node.java.awt.Point
getLocation()
double
getPenalty()
AStarNode
getPredecessor()
boolean
isWalkable()
void
setGCost(double gCost)
void
setHCost(double hCost)
void
setPenalty(double penalty)
void
setPredecessor(AStarNode predecessor)
void
setWalkable(boolean walkable)
java.lang.String
toString()
Constructor Details
AStarNode
public AStarNode(boolean walkable, java.awt.Rectangle bound, int gridX, int gridY)
Method Details
getBounds
public java.awt.Rectangle getBounds()getCosts
getFCost
public double getFCost()Gets the total costs for this node.- Returns:
- The total costs.
getGCost
public double getGCost()Gets the costs so far for this node.- Returns:
- The costs so far.
getGridX
public int getGridX()getGridY
public int getGridY()getHCost
public double getHCost()Gets the estimated costs for this node.- Returns:
- The estimated costs.
getLocation
public java.awt.Point getLocation()getPenalty
public double getPenalty()getPredecessor
isWalkable
public boolean isWalkable()setGCost
public void setGCost(double gCost)setHCost
public void setHCost(double hCost)setPenalty
public void setPenalty(double penalty)setPredecessor
setWalkable
public void setWalkable(boolean walkable)clear
public void clear()Clears the assigned costs and the predecessor.toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object