Packagebe.dauntless.astar.core
Classpublic class Analyzer
InheritanceAnalyzer Inheritance Object
Subclasses FullClipping3DAnalyzer, FullClippingAnalyzer, GravityAnalyzer, HeightAnalyzer, OccupationAnalyzer, SmartClippingAnalyzer, WalkableAnalyzer

The Analyzer class describes searching constraints for the Astar class. Analyzers can be linked together using the Astar.addAnalyzer. You can create your own Analyzer by extending the Analyzer class and overriding the Analyzer.analyzeTile and Analyzer.analyze methods.



Protected Properties
 PropertyDefined By
  _subAnalyzer : Analyzer
Analyzer
Public Methods
 MethodDefined By
  
Analyzer
  
analyzeTile(mainTile:IAstarTile, req:PathRequest):Boolean
Used to validate a single tile.
Analyzer
  
Removes an analyzer from the chain.
Analyzer
  
setSubAnalyzer(subAnalyzer:Analyzer):void
Chains the given subAnalyzer to this analyzer
Analyzer
  
subAnalyze(mainTile:DataTile, allNeighbours:Vector.<IAstarTile>, neighboursLeft:Vector.<IAstarTile>, req:PathRequest):Vector.<IAstarTile>
Manages the propper chaining of the subanalyzers.
Analyzer
  
subAnalyzeTile(mainTile:IAstarTile, req:PathRequest):Boolean
Analyzes if a single tile is valid.
Analyzer
Protected Methods
 MethodDefined By
  
analyze(mainTile:IAstarTile, allNeighbours:Vector.<IAstarTile>, neighboursLeft:Vector.<IAstarTile>, request:PathRequest):Vector.<IAstarTile>
Eliminates neighbours from the given array and returns the neighbours that were valid.
Analyzer
  
Analyzer
Property Detail
_subAnalyzerproperty
protected var _subAnalyzer:Analyzer

Constructor Detail
Analyzer()Constructor
public function Analyzer()



Method Detail
analyze()method
protected function analyze(mainTile:IAstarTile, allNeighbours:Vector.<IAstarTile>, neighboursLeft:Vector.<IAstarTile>, request:PathRequest):Vector.<IAstarTile>

Eliminates neighbours from the given array and returns the neighbours that were valid.

Parameters

mainTile:IAstarTile — The tile who's neighbours are passed
 
allNeighbours:Vector.<IAstarTile> — A list consisting of all the neighbours, including those that were removed by other analyzers
 
neighboursLeft:Vector.<IAstarTile> — A list consisting of all the neighbours that have passed all the other analyzers. This is the list that should be modified and returned.
 
request:PathRequest — The PathRequest that is currently being executed

Returns
Vector.<IAstarTile> — A list consisting of all the neighbours that passed this analyzer
analyzeTile()method 
public function analyzeTile(mainTile:IAstarTile, req:PathRequest):Boolean

Used to validate a single tile. This method is used to see if the start/end tile is a valid tile.

Parameters

mainTile:IAstarTile — The tile that is being analyzed
 
req:PathRequest — The path request that is currently being executed

Returns
Boolean — A boolean indicating whether or not the tile is valid
getSubAnalyzer()method 
protected final function getSubAnalyzer():Analyzer

Returns
Analyzer
removeAnalyzer()method 
public final function removeAnalyzer(toRemove:Analyzer):Analyzer

Removes an analyzer from the chain. If this isn't the analyzer that has to be removed, it is passed along the chain.

Parameters

toRemove:Analyzer

Returns
Analyzer — Analyzer The sub analyzer of the analyzer that is removed. This is used to maintain the chain property
setSubAnalyzer()method 
public final function setSubAnalyzer(subAnalyzer:Analyzer):void

Chains the given subAnalyzer to this analyzer

Parameters

subAnalyzer:Analyzer — The subAnalyzer to chain to this analyzer

subAnalyze()method 
public final function subAnalyze(mainTile:DataTile, allNeighbours:Vector.<IAstarTile>, neighboursLeft:Vector.<IAstarTile>, req:PathRequest):Vector.<IAstarTile>

Manages the propper chaining of the subanalyzers. Backups are created, the DataTiles are converted to their containing tile, analyzed and converted back to DataTiles.

Parameters

mainTile:DataTile — The tile who's neighbours are being analyzed
 
allNeighbours:Vector.<IAstarTile> — A list containing all the neighbours of the mainTile
 
neighboursLeft:Vector.<IAstarTile> — A list containing the neighbours of the mainTile that have passed the other analyzers up untill now
 
req:PathRequest — The PathRequest that is currently being executed

Returns
Vector.<IAstarTile> — A list with the tiles that have passed this analyzer
subAnalyzeTile()method 
public final function subAnalyzeTile(mainTile:IAstarTile, req:PathRequest):Boolean

Analyzes if a single tile is valid. Used for start and end point

Parameters

mainTile:IAstarTile — The tile that is being analyzed
 
req:PathRequest — The path request that is currently being executed

Returns
Boolean — A boolean indicating whether or not the tile is valid