Skip to content

Home > @esengine/ecs-framework-monorepo > ComponentIndex

ComponentIndex class

通用组件索引实现

基于Sparse Set算法: - O(1)的实体添加、删除、查找 - 高效的位运算查询 - 内存紧凑的存储结构 - 缓存友好的遍历性能

Signature:

typescript
export declare class ComponentIndex implements IComponentIndex

Implements: IComponentIndex

Constructors

Constructor

Modifiers

Description

(constructor)()

Constructs a new instance of the ComponentIndex class

Methods

Method

Modifiers

Description

addEntity(entity)

clear()

getStats()

query(componentType)

queryMultiple(componentTypes, operation)

removeEntity(entity)

基于 MIT 许可证发布