ConceptCreator/src/app/project/game-model/gamesystems/ProductTemplateGamesystem.ts
Sebastian Böckelmann 28a520a995
All checks were successful
E2E Testing / test (push) Successful in 1m42s
Implement GameModel Support for Character Specific Gamesystems
2024-04-10 20:02:56 +02:00

26 lines
836 B
TypeScript

import { ProductGamesystem } from "./ProductGamesystem";
import { SimpleGamesystem } from "./SimpleGamesystem";
import { SimpleTemplateGamesystem } from "./SimpleTemplateGamesystem";
export class ProductTemplateGamesystem extends ProductGamesystem {
referenceSystem: ProductGamesystem
constructor(referenceSystem: ProductGamesystem) {
super(referenceSystem.componentName, referenceSystem.componentDescription)
this.referenceSystem = referenceSystem;
this.innerGamesystems = referenceSystem.innerGamesystems.map(innerGamesystem => {
if(innerGamesystem instanceof SimpleGamesystem) {
return new SimpleTemplateGamesystem(innerGamesystem)
} else {
return new ProductTemplateGamesystem(innerGamesystem as ProductTemplateGamesystem)
}
})
this.generateFromChildsystems();
}
}