Road  4
 All Classes Functions Variables
Classes | Public Member Functions | Public Attributes | List of all members
Road Class Reference

A Road Pathfinder. More...

Classes

class  Cost

Public Member Functions

function GetAuthor ()
function GetName ()
function GetShortName ()
function GetDescription ()
function GetVersion ()
function GetDate ()
function CreateInstance ()
function GetCategory ()
function InitializePath (sources, goals)
 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 Road Pathfinder.

This road pathfinder tries to find a buildable / existing route for road vehicles. You can changes the costs below using for example roadpf.cost.turn = 30. Note that it's not allowed to change the cost between consecutive calls to FindPath. You can change the cost before the first call to FindPath and after FindPath has returned an actual route. To use only existing roads, set cost.no_existing_road to cost.max_cost.

Member Function Documentation

function Road::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 Road::InitializePath ( sources  ,
goals   
)
inline

Initialize a path search between sources and goals.

Parameters
sourcesThe source tiles.
goalsThe target tiles.
See Also
AyStar::InitializePath()

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