* 将系统添加到指定组件的索引 * * Add system to the index for a specific component type. * * @param componentType 组件类型 | Component type * @param system 系统 | System
(componentType: ComponentType, system: EntitySystem)
| 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 | * 从组件索引中移除系统 |
no test coverage detected