java.lang.Object
games.stendhal.server.core.pathfinder.Path

public abstract class Path extends Object
  • Constructor Details

    • Path

      public Path()
  • Method Details

    • searchPath

      public static List<Node> searchPath(Entity entity, int ex, int ey)
      Finds a path for the Entity entity.
      Parameters:
      entity - the Entity
      ex - destination x
      ey - destination y
      Returns:
      a list with the path nodes or an empty list if no path is found
    • searchPath

      public static List<Node> searchPath(Entity entity, int x, int y, Rectangle2D destination, double maxDistance)
      Finds a path for the Entity entity.
      Parameters:
      entity - the Entity
      x - start x
      y - start y
      destination - the destination area
      maxDistance - the maximum distance (as the crow flies) a possible path may be
      Returns:
      a list with the path nodes or an empty list if no path is found
    • searchPath

      public static List<Node> searchPath(Entity sourceEntity, StendhalRPZone zone, int x, int y, Rectangle2D destination, double maxDistance, boolean withEntities)
      Finds a path for the Entity entity.
      Parameters:
      sourceEntity - the Entity
      zone - the zone, if null the current zone of entity is used.
      x - start x
      y - start y
      destination - the destination area
      maxDistance - the maximum distance (air line) a possible path may be
      withEntities -
      Returns:
      a list with the path nodes or an empty list if no path is found
    • searchPath

      public static List<Node> searchPath(StendhalRPZone zone, int startX, int startY, int destX, int destY, double maxDistance)
      Find an one tile wide path. Entities on the map are ignored.
      Parameters:
      zone - zone to search
      startX - x coordinate of the starting point
      startY - y coordinate of the starting point
      destX - x coordinate of the destination
      destY - y coordinate of the destination
      maxDistance - maximum search distance
      Returns:
      found path, or an empty list if no path was found
    • searchPath

      public static List<Node> searchPath(Entity entity, Entity dest, double maxDistance)
      Finds a path for the Entity entity to the other Entity dest.
      Parameters:
      entity - the Entity (also start point)
      dest - the destination Entity
      maxDistance - the maximum distance (air line) a possible path may be
      Returns:
      a list with the path nodes or an empty list if no path is found