UNPKG
@esengine/pathfinding
Version:
latest (13.3.3)
13.3.3
13.3.2
13.3.1
13.3.0
13.2.0
13.1.0
13.0.0
12.1.2
12.1.0
12.0.0
11.0.0
10.0.0
9.0.0
8.0.0
7.0.0
6.0.0
5.0.0
4.0.1
4.0.0
3.0.1
3.0.0
2.0.1
2.0.0
1.1.0
1.0.8
1.0.7
1.0.3
1.0.2
1.0.1
1.0.0
寻路算法库,支持A*、广度优先等算法,适用于Cocos Creator、Laya等游戏引擎
@esengine/pathfinding
/
src
/
AI
/
Pathfinding
/
BreadthFirst
/
IUnweightedGraph.ts
15 lines
(13 loc)
•
401 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { IVector2 }
from
'../../../Types/IVector2'
;
/** * 无权图接口,用于广度优先搜索 *
@template
T 节点类型,通常是实现了IVector2的类型 */
export
interface
IUnweightedGraph
<
T
extends
IVector2
>
{
/** * 获取指定节点的邻居节点 *
@param
node 当前节点 *
@returns
邻居节点数组 */
getNeighbors
(
node
: T): T[]; }