| 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); |
nothing calls this directly
no test coverage detected