MCPcopy Create free account
hub / github.com/esengine/esengine / addSystemToComponentIndex

Method addSystemToComponentIndex

packages/core/src/ECS/Scene.ts:741–751  ·  view source on GitHub ↗

* 将系统添加到指定组件的索引 * * Add system to the index for a specific component type. * * @param componentType 组件类型 | Component type * @param system 系统 | System

(componentType: ComponentType, system: EntitySystem)

Source from the content-addressed store, hash-verified

739 * @param system 系统 | System
740 */
741 private addSystemToComponentIndex(componentType: ComponentType, system: EntitySystem): void {
742 const componentId = this.componentRegistry.getBitIndex(componentType);
743 let systems = this._componentIdToSystems.get(componentId);
744
745 if (!systems) {
746 systems = new Set();
747 this._componentIdToSystems.set(componentId, systems);
748 }
749
750 systems.add(system);
751 }
752
753 /**
754 * 从组件索引中移除系统

Callers 1

Calls 4

getMethod · 0.65
setMethod · 0.65
getBitIndexMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected