Class Path
java.lang.Object
games.stendhal.server.core.pathfinder.Path
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionsearchPath(StendhalRPZone zone, int startX, int startY, int destX, int destY, double maxDistance)
Find an one tile wide path.searchPath(Entity entity, int ex, int ey)
Finds a path for the Entityentity
.searchPath(Entity entity, int x, int y, Rectangle2D destination, double maxDistance)
Finds a path for the Entityentity
.searchPath(Entity sourceEntity, StendhalRPZone zone, int x, int y, Rectangle2D destination, double maxDistance, boolean withEntities)
Finds a path for the Entityentity
.searchPath(Entity entity, Entity dest, double maxDistance)
Finds a path for the Entityentity
to the other Entitydest
.
-
Constructor Details
-
Path
public Path()
-
-
Method Details
-
searchPath
Finds a path for the Entityentity
.- Parameters:
entity
- the Entityex
- destination xey
- 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 Entityentity
.- Parameters:
entity
- the Entityx
- start xy
- start ydestination
- the destination areamaxDistance
- 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 Entityentity
.- Parameters:
sourceEntity
- the Entityzone
- the zone, if null the current zone of entity is used.x
- start xy
- start ydestination
- the destination areamaxDistance
- the maximum distance (air line) a possible path may bewithEntities
-- 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 searchstartX
- x coordinate of the starting pointstartY
- y coordinate of the starting pointdestX
- x coordinate of the destinationdestY
- y coordinate of the destinationmaxDistance
- maximum search distance- Returns:
- found path, or an empty list if no path was found
-
searchPath
Finds a path for the Entityentity
to the other Entitydest
.- Parameters:
entity
- the Entity (also start point)dest
- the destination EntitymaxDistance
- 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
-