Skip to content

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

ComponentRegistry class

组件注册表 管理组件类型的位掩码分配

Signature:

typescript
export declare class ComponentRegistry

Properties

Property

Modifiers

Type

Description

_logger

protected

static

readonly

import("../../../Utils/Logger").ILogger

Methods

Method

Modifiers

Description

clearMaskCache()

static

清除掩码缓存

createComponentMask(componentNames)

static

创建多个组件的掩码

createSingleComponentMask(componentName)

static

创建单个组件的掩码

getAllComponentNames()

static

获取所有组件名称到类型的映射

getAllRegisteredTypes()

static

获取所有已注册的组件类型

getBitIndex(componentType)

static

获取组件类型的位索引

getBitMask(componentType)

static

获取组件类型的位掩码

getComponentId(componentName)

static

通过名称获取组件类型ID

getComponentType(componentName)

static

通过名称获取组件类型

isRegistered(componentType)

static

检查组件类型是否已注册

register(componentType)

static

注册组件类型并分配位掩码

registerComponentByName(componentName)

static

注册组件类型(通过名称)

reset()

static

重置注册表(用于测试)

基于 MIT 许可证发布