WormAIDev  Worm SELF_VERSION
 All Classes Files Functions Variables Pages
Classes | Public Member Functions | Public Attributes | List of all members
Rail Class Reference

A Rail Pathfinder. More...

Inheritance diagram for Rail:
WormRailPathFinder

Classes

class  Cost

Public Member Functions

function InitializePath (sources, goals, ignored_tiles=[])
 Initialize a path search between sources and goals.
function FindPath (iterations)
 Try to find the path as indicated with InitializePath with the lowest cost.

Public Attributes

 cost = null
 Used to change the costs.

Detailed Description

A Rail Pathfinder.

Member Function Documentation

function Rail::FindPath ( iterations  )

Try to find the path as indicated with InitializePath with the lowest cost.

Parameters
iterationsAfter how many iterations it should abort for a moment. This value should either be -1 for infinite, or > 0. Any other value aborts immediatly and will never find a path.
Returns
A route if one was found, or false if the amount of iterations was reached, or null if no path was found. You can call this function over and over as long as it returns false, which is an indication it is not yet done looking for a route.
See Also
AyStar::FindPath()
function Rail::InitializePath ( sources  ,
goals  ,
ignored_tiles  = [] 
)
inline

Initialize a path search between sources and goals.

Parameters
sourcesThe source tiles.
goalsThe target tiles.
ignored_tilesAn array of tiles that cannot occur in the final path.
See Also
AyStar::InitializePath()

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