Package com.mygdx.auber.Pathfinding
Class Node
- java.lang.Object
-
- com.mygdx.auber.Pathfinding.Node
-
public class Node extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Node(float nodeX, float nodeY)The class constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetIndex()Gets the index of this node.floatgetX()Gets the x coordinate of this node.floatgetY()Gets the y coordinate of this node.voidrender(com.badlogic.gdx.graphics.glutils.ShapeRenderer shapeRenderer, com.badlogic.gdx.graphics.g2d.SpriteBatch batch, com.badlogic.gdx.graphics.g2d.BitmapFont font, boolean inPath)Renderer for the nodes, used for debugging purposes.voidsetIndex(int newIndex)Setter for the index of the node, used for A* Indexed search.
-
-
-
Method Detail
-
setIndex
public void setIndex(int newIndex)
Setter for the index of the node, used for A* Indexed search.- Parameters:
newIndex- The index to assign the node.
-
render
public void render(com.badlogic.gdx.graphics.glutils.ShapeRenderer shapeRenderer, com.badlogic.gdx.graphics.g2d.SpriteBatch batch, com.badlogic.gdx.graphics.g2d.BitmapFont font, boolean inPath)Renderer for the nodes, used for debugging purposes.- Parameters:
shapeRenderer- The shape renderer being used.batch- The sprite batch being used.font- The font to use.inPath- Whether this node is in the path.
-
getIndex
public int getIndex()
Gets the index of this node.- Returns:
- An int containing this node's index.
-
getX
public float getX()
Gets the x coordinate of this node.- Returns:
- An int containing this node's x coordinate.
-
getY
public float getY()
Gets the y coordinate of this node.- Returns:
- An int containing this node's y coordinate.
-
-