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

Class CombatSystem

packages/core/tests/ECS/EntitySystemDI.test.ts:459–475  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

457 }
458
459 @Injectable()
460 @ECSSystem('Combat')
461 class CombatSystem extends EntitySystem implements IService {
462 @InjectProperty(GameConfig)
463 gameConfig!: GameConfig;
464
465 constructor() {
466 super(Matcher.empty().all(Health));
467 }
468
469 protected override onInitialize(): void {
470 expect(this.gameConfig).toBeInstanceOf(GameConfig);
471 expect(this.gameConfig.bulletDamage).toBe(10);
472 }
473
474 override dispose() {}
475 }
476
477 scene.addEntityProcessor(GameConfig);
478 scene.addEntityProcessor(CombatSystem);

Callers

nothing calls this directly

Calls 3

InjectableFunction · 0.90
ECSSystemFunction · 0.90
InjectPropertyFunction · 0.90

Tested by

no test coverage detected