(entityId: number)
| 587 | } |
| 588 | |
| 589 | public removeComponent(entityId: number): T | null { |
| 590 | const index = this.entityToIndex.get(entityId); |
| 591 | if (index === undefined) { |
| 592 | return null; |
| 593 | } |
| 594 | |
| 595 | // 获取组件副本以便返回 |
| 596 | const component = this.getComponent(entityId); |
| 597 | |
| 598 | // 清理复杂字段 |
| 599 | this.complexFields.delete(entityId); |
| 600 | |
| 601 | this.entityToIndex.delete(entityId); |
| 602 | this.freeIndices.push(index); |
| 603 | this._size--; |
| 604 | return component; |
| 605 | } |
| 606 | |
| 607 | private resize(newCapacity: number): void { |
| 608 | // 调整数值字段的TypedArray |
nothing calls this directly
no test coverage detected