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

Protected Member Functions

List< CoordinatecalcPath (World world, Coordinate start, Coordinate end)
 

Additional Inherited Members

- 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

Implements Bresenham's line drawing algorithm for finding straight paths. Note that the integer only optimization is not included as using floats makes for more intuitive and readable code. Hopefully the performance issues of using a float are not what they were back in the days of Bresenham.

Member Function Documentation

List<Coordinate> jade.path.Bresenham.calcPath ( World  world,
Coordinate  start,
Coordinate  end 
)
protectedvirtual

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: