Class AStarNode
java.lang.Object
de.gurkenlabs.litiengine.entities.behavior.AStarNode
public class AStarNode
extends java.lang.ObjectConstructor Summary
Constructors Constructor Description AStarNode(boolean walkable, java.awt.Rectangle bound, int gridX, int gridY)Method Summary
Modifier and Type Method Description voidclear()Clears the assigned costs and the predecessor.java.awt.RectanglegetBounds()doublegetCosts(AStarNode target)doublegetFCost()Gets the total costs for this node.doublegetGCost()Gets the costs so far for this node.intgetGridX()intgetGridY()doublegetHCost()Gets the estimated costs for this node.java.awt.PointgetLocation()doublegetPenalty()AStarNodegetPredecessor()booleanisWalkable()voidsetGCost(double gCost)voidsetHCost(double hCost)voidsetPenalty(double penalty)voidsetPredecessor(AStarNode predecessor)voidsetWalkable(boolean walkable)java.lang.StringtoString()
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:
toStringin classjava.lang.Object
