Skip to content

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

SoAStorage class

SoA存储器(需要装饰器启用) 使用Structure of Arrays存储模式,在大规模批量操作时提供优异性能

Signature:

typescript
export declare class SoAStorage<T extends Component>

Constructors

Constructor

Modifiers

Description

(constructor)(componentType)

Constructs a new instance of the SoAStorage class

Properties

Property

Modifiers

Type

Description

type

readonly

ComponentType<T>

Methods

Method

Modifiers

Description

addComponent(entityId, component)

clear()

compact()

getActiveIndices()

getComponent(entityId)

getEntityIdByIndex(index)

getEntityIndex(entityId)

getFieldArray(fieldName)

getStats()

getTypedFieldArray(fieldName)

hasComponent(entityId)

performVectorizedOperation(operation)

执行向量化批量操作

removeComponent(entityId)

size()

基于 MIT 许可证发布