Class AStarAlgorithm

java.lang.Object
com.epicbot.api.shared.model.path.finding.AStarAlgorithm

public class AStarAlgorithm extends Object
A* path finding algorithm.
  • Constructor Details

    • AStarAlgorithm

      public AStarAlgorithm()
  • Method Details

    • findPath

      public static Tile[] findPath(Locatable origin, Locatable destination, APIContext ctx)
      Finds a path from origin to destination.
      Parameters:
      origin - the start point
      destination - the end point
      ctx - APIContext
      Returns:
      the tile path or null if not reachable
    • distance

      public static double distance(Locatable origin, Locatable destination, APIContext ctx)
      Calculates the distance between the origin and the destination.
      Parameters:
      origin - to calculate distance from
      destination - to calculate the distance to
      ctx - APIContext
      Returns:
      the calculated distance or Double.POSITIVE_INFINITY if not reachable
    • distance

      public static double distance(Locatable origin, Locatable destination, boolean ignoreObjects, APIContext ctx)
      Calculates the distance between the origin and the destination. Does not take objects in to account
      Parameters:
      origin - to calculate distance from
      destination - to calculate the distance to
      ctx - APIContext
      Returns:
      the calculated distance or Double.POSITIVE_INFINITY if not reachable