| Property | Defined by | ||
|---|---|---|---|
| maxTry : int
最大寻路步数,限制超时返回
| AStar | ||
| Method | Defined by | ||
|---|---|---|---|
|
AStar(p_mapTileModel:IMapTileModel, p_maxTry:int = 500)
Constructor
| AStar | ||
|
find(p_startX:int, p_startY:int, p_endX:int, p_endY:int):Array
开始寻路
| AStar | ||
| maxTry | property |
maxTry:int [read-write]最大寻路步数,限制超时返回
Implementation public function get maxTry():int
public function set maxTry(value:int):void
| AStar | () | constructor |
public function AStar(p_mapTileModel:IMapTileModel, p_maxTry:int = 500)Constructor
Parametersp_mapTileModel:IMapTileModel — 地图模型,实现 IMapTileModel 接口
|
|
p_maxTry:int (default = 500) — 最大寻路步数,限制超时返回
|
| find | () | method |
public function find(p_startX:int, p_startY:int, p_endX:int, p_endY:int):Array开始寻路
Parametersp_startX:int — 起点X坐标
|
|
p_startY:int — 起点Y坐标
|
|
p_endX:int — 终点X坐标
|
|
p_endY:int — 终点Y坐标
|
Array — 找到的路径(二维数组 : [p_startX, p_startY], ... , [p_endX, p_endY])
|