Class Path

  • All Implemented Interfaces:
    com.badlogic.gdx.ai.pfa.Connection<Node>

    public class Path
    extends java.lang.Object
    implements com.badlogic.gdx.ai.pfa.Connection<Node>
    • Constructor Summary

      Constructors 
      Constructor Description
      Path​(Node newFromNode, Node newToNode)
      Class constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      float getCost()
      Returns the cost of the path.
      Node getFromNode()
      Returns the node the path comes from.
      Node getToNode()
      Returns the node the path goes to.
      void render​(com.badlogic.gdx.graphics.glutils.ShapeRenderer shapeRenderer)
      Render method for rendering the paths between nodes, used for debugging purposes.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Path

        public Path​(Node newFromNode,
                    Node newToNode)
        Class constructor.
        Parameters:
        newFromNode - The origin node for this path.
        newToNode - The destination node for this path.
    • Method Detail

      • render

        public void render​(com.badlogic.gdx.graphics.glutils.ShapeRenderer shapeRenderer)
        Render method for rendering the paths between nodes, used for debugging purposes.
        Parameters:
        shapeRenderer - The shape renderer being used.
      • getCost

        public float getCost()
        Returns the cost of the path.
        Specified by:
        getCost in interface com.badlogic.gdx.ai.pfa.Connection<Node>
        Returns:
        A float containing the cost.
      • getFromNode

        public Node getFromNode()
        Returns the node the path comes from.
        Specified by:
        getFromNode in interface com.badlogic.gdx.ai.pfa.Connection<Node>
        Returns:
        The origin node.
      • getToNode

        public Node getToNode()
        Returns the node the path goes to.
        Specified by:
        getToNode in interface com.badlogic.gdx.ai.pfa.Connection<Node>
        Returns:
        The destination node.