Adventure at Umalu  22nd March, 2013
Rogue-like Dungeon Crawler, written in Java
 All Classes Functions Variables Pages
Classes | Public Member Functions | List of all members
jade.path.AStar Class Reference
Inheritance diagram for jade.path.AStar:
jade.path.PathFinder

Public Member Functions

List< CoordinatecalcPath (World world, Coordinate start, Coordinate end)
 
- Public Member Functions inherited from jade.path.PathFinder
final List< CoordinategetPartialPath (World world, Coordinate start, Coordinate end)
 
final List< CoordinategetPartialPath (World world, int posX, int posY, int endX, int endY)
 
final List< CoordinategetPath (World world, Coordinate start, Coordinate end)
 
final List< CoordinategetPath (World world, int posX, int posY, int endX, int endY)
 

Detailed Description

A

PathFinder

which uses the A* path finding algorithm to quickly calculate optimal paths. The implementation uses Cartesian distance as both traversal cost and heuristic estimates. If a path exists it is guaranteed to be found, and an optimal path will always be returned. If no path exists, a partial path from the accessible location closest to the goal will be returned.

Member Function Documentation

List<Coordinate> jade.path.AStar.calcPath ( World  world,
Coordinate  start,
Coordinate  end 
)
virtual

Calculates and returns the partial path from the given start to end on the provided

World

. Since the path is incomplete, it may or may not terminate at the provided end. Null should never be returned from this method. If a path cannot be found, a partial path, or at least an empty path should be returned.

Parameters
worldthe world on which the path is calculated
startthe start of the calculated path
endthe intended end of the calculated path
Returns
a path from start to end on world

Implements jade.path.PathFinder.


The documentation for this class was generated from the following file: