Interface Navigatable<NodeId>

All Known Implementing Classes:
SimpleNavGraph, Sparse2DTiledSurface_NavGraph, SurfaceNavGraph

public interface Navigatable<NodeId>
Describes a graph-like structure that can be navigated by a pathfinder.
Author:
Naraenda
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    distance​(NodeId from, NodeId to)
    The distance between two connected vertices.
    float
    heuristic​(NodeId from, NodeId to)
    The estimated distance between two arbitairy vertices.
    An interable that can be used by pathfinders to explore a node's connections.
  • Method Details

    • neighbours

      Iterable<NodeId> neighbours(NodeId id)
      An interable that can be used by pathfinders to explore a node's connections.
      Parameters:
      id - the index of the vertex to inspect.
      Returns:
      an iterable of the connected neighbours.
    • heuristic

      float heuristic(NodeId from, NodeId to)
      The estimated distance between two arbitairy vertices.
      Parameters:
      from - : the index of the vertex to travel from.
      to - : the index of the vertex to travel to.
      Returns:
      the estimated distance.
    • distance

      float distance(NodeId from, NodeId to)
      The distance between two connected vertices.
      Parameters:
      from - : the index of the vertex to travel from.
      to - : the index of the vertex to travel to.
      Returns:
      the measured distance. NaN if nodes are not connected.