AABB
AlignmentBehavior
ArriveBehavior
AStar
BFS
BoundingSphere
BVH
BVHNode
Cell
CellSpacePartitioning
CohesionBehavior
CompositeGoal
ConvexHull
Corridor
CostTable
DFS
Dijkstra
Edge
EntityManager
EvadeBehavior
EventDispatcher
Behavior
FollowPathBehavior
FuzzyAND
FuzzyCompositeTerm
FuzzyFAIRLY
FuzzyModule
FuzzyOR
FuzzyRule
FuzzySet
FuzzyTerm
FuzzyVariable
FuzzyVERY
GameEntity
Goal
GoalEvaluator
Graph
GraphUtils
HalfEdge
HeuristicPolicyDijkstra
HeuristicPolicyEuclid
HeuristicPolicyEuclidSquared
HeuristicPolicyManhattan
InterposeBehavior
LeftSCurveFuzzySet
LeftShoulderFuzzySet
LineSegment
Logger
MathUtils
Matrix3
Matrix4
MemoryRecord
MemorySystem
MeshGeometry
MessageDispatcher
MovingEntity
NavEdge
NavMesh
NavMeshLoader
NavNode
Node
NormalDistFuzzySet
OBB
ObstacleAvoidanceBehavior
OffsetPursuitBehavior
OnPathBehavior
Path
Plane
Polygon
Polyhedron
PriorityQueue
PursuitBehavior
Quaternion
Ray
RectangleTriggerRegion
Regular
RightSCurveFuzzySet
RightShoulderFuzzySet
SAT
SeekBehavior
SeparationBehavior
SingletonFuzzySet
Smoother
SphericalTriggerRegion
State
StateMachine
SteeringBehavior
SteeringManager
Task
TaskQueue
Telegram
Think
Time
TriangularFuzzySet
Trigger
TriggerRegion
Vector3
Vehicle
Version
WanderBehavior

manager

GameEntitymanager 是负责管理游戏实体的对象。它提供了添加、移除及查询游戏实体的功能。

添加实体

manager.add(entity: GameEntity): void

参数 entity 是一个 GameEntity 实例。

移除实体

manager.remove(entity: GameEntity): void

参数 entity 是一个 GameEntity 实例。

查询实体

manager.getEntityById(id: number): GameEntity | undefined
manager.getEntitiesByTag(tag: string): GameEntity[]
manager.getAllEntities(): GameEntity[]

方法 getEntityById 接收一个实体 ID,并返回该 ID 对应的实体。

方法 getEntitiesByTag 接收一个实体标签,并返回该标签对应的所有实体。

方法 getAllEntities 返回添加到 manager 中的所有实体。

实例化

const manager = new Manager()

manager 可以通过 new Manager() 创建一个实例。