| Package | be.dauntless.astar.core |
| Class | public class Astar |
| Inheritance | Astar flash.events.EventDispatcher |
| Property | Defined By | ||
|---|---|---|---|
| intervalTime : Number [write-only]
Sets the time between two consecutive iteration series. | Astar | ||
| iterations : Number [write-only]
Sets the number of iterations done within 1 timespan. | Astar | ||
| safety : String
Returns the current safety level. | Astar | ||
| Method | Defined By | ||
|---|---|---|---|
Astar(cache:Boolean = false)
Creates a new Astar instance
| Astar | ||
addAnalyzer(analyzer:Analyzer):void
Add an analyzer to the analyzer chain. | Astar | ||
clearCache():void
Clears the cached paths
| Astar | ||
getPath(item:PathRequest):void
Enqueues the given PathRequest or executes the request if the queue is empty. | Astar | ||
| Constant | Defined By | ||
|---|---|---|---|
| NO_CHECK : String = noCheck [static]
If Astar.safeMode is set to NO_CHECK, nothing will be checked for at the start of a new search
| Astar | ||
| NORMAL_CHECK : String = normalCheck [static]
If Astar.safeMode is set to NORMAL_CHECK (default), the following will be tested:
- The end tile has to be a valid tile according to the analyzers (Analyzer.analyzeTile)
Note that only the end tile is checked. | Astar | ||
| intervalTime | property |
intervalTime:Number [write-only] Sets the time between two consecutive iteration series.
public function set intervalTime(value:Number):void| iterations | property |
iterations:Number [write-only] Sets the number of iterations done within 1 timespan.
public function set iterations(value:Number):void| safety | property |
safety:StringReturns the current safety level.
public function get safety():String public function set safety(value:String):void| Astar | () | Constructor |
public function Astar(cache:Boolean = false)Creates a new Astar instance
Parameterscache:Boolean (default = false) — If set to true, Astar will remember paths that have been found and it will returned cached paths in stead of searching for the path again. Set to true if your map always stays the same and all your PathRequests will have the same conditions. (Default = false)
|
| addAnalyzer | () | method |
public function addAnalyzer(analyzer:Analyzer):voidAdd an analyzer to the analyzer chain. Analyzers added to the Astar instance will be checked before analyzers added to the PathRequest
Parameters
analyzer:Analyzer — The analyzer to add to the analyzer chain
|
| clearCache | () | method |
public function clearCache():voidClears the cached paths
| getPath | () | method |
public function getPath(item:PathRequest):voidEnqueues the given PathRequest or executes the request if the queue is empty. When a path is found, an AstarEvent.PATH_FOUND event is dispatched. If caching is set to true and a cached path is found, the PathRequest will not be added to the queue and the cached path will be dispatched immediately.
Parameters
item:PathRequest — The PathRequest containing the search info
|
| NO_CHECK | Constant |
public static const NO_CHECK:String = noCheckIf Astar.safeMode is set to NO_CHECK, nothing will be checked for at the start of a new search
| NORMAL_CHECK | Constant |
public static const NORMAL_CHECK:String = normalCheckIf Astar.safeMode is set to NORMAL_CHECK (default), the following will be tested: - The end tile has to be a valid tile according to the analyzers (Analyzer.analyzeTile) Note that only the end tile is checked. It is assumed that you start from a valid position.