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

Method process

packages/core/tests/ECS/Systems/EntitySystem.test.ts:998–1014  ·  view source on GitHub ↗
(entities: readonly Entity[])

Source from the content-addressed store, hash-verified

996 super(Matcher.all(CComponent));
997 }
998 protected override process(entities: readonly Entity[]): void {
999 for (const entity of entities) {
1000 const c = entity.getComponent(CComponent);
1001 if (c) {
1002 const a = this.scene!.findEntityById(c.aId);
1003 if (a && !a.hasComponent(DComponent)) {
1004 console.log('CSystem: Adding D to Entity A');
1005 a.addComponent(new DComponent());
1006 }
1007 const b = this.scene!.findEntityById(c.bId);
1008 if (b && !b.hasComponent(DComponent)) {
1009 console.log('CSystem: Adding D to Entity B');
1010 b.addComponent(new DComponent());
1011 }
1012 }
1013 }
1014 }
1015 }
1016
1017 // DSystem: 在 lateProcess 中移除 D 组件

Callers

nothing calls this directly

Calls 5

getComponentMethod · 0.45
findEntityByIdMethod · 0.45
hasComponentMethod · 0.45
logMethod · 0.45
addComponentMethod · 0.45

Tested by

no test coverage detected