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

Class ConsumerSystem

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

Source from the content-addressed store, hash-verified

536 }
537
538 @Injectable()
539 @ECSSystem('Consumer')
540 class ConsumerSystem extends EntitySystem implements IService {
541 @InjectProperty(TestService)
542 service!: TestService;
543
544 private initializeValue = 0;
545
546 constructor() {
547 super(Matcher.empty());
548 }
549
550 protected override onInitialize(): void {
551 this.initializeValue = this.service.value;
552 }
553
554 public getInitializeValue(): number {
555 return this.initializeValue;
556 }
557
558 override dispose() {}
559 }
560
561 scene.addEntityProcessor(TestService);
562 const consumer = scene.addEntityProcessor(ConsumerSystem);

Callers

nothing calls this directly

Calls 3

InjectableFunction · 0.90
ECSSystemFunction · 0.90
InjectPropertyFunction · 0.90

Tested by

no test coverage detected