product-template-systems #33

Merged
sebastian merged 8 commits from product-template-systems into template-systems 2024-04-14 11:45:39 +02:00
Showing only changes of commit 49521cba87 - Show all commits

View File

@ -4,6 +4,8 @@ import {TemplateElement} from "../templates/TemplateElement";
import {TemplateGamesystem} from "../templates/TemplateGamesystem";
import {Gamesystem} from "../gamesystems/Gamesystem";
import {SimpleTemplateGamesystem} from "../templates/simpleGamesystem/SimpleTemplateGamesystem";
import {ProductTemplateSystem} from "../templates/productGamesystem/ProductTemplateSystem";
import {ProductGamesystem} from "../gamesystems/ProductGamesystem";
export class Character extends ModelComponent implements TemplateElement {
@ -13,10 +15,20 @@ export class Character extends ModelComponent implements TemplateElement {
super(componentName, componentDescription, ModelComponentType.CHARACTER);
}
addCharacterSpecificSimpleTemplatesystem(gamesystem: SimpleTemplateGamesystem) {
addCharacterSpecificSimpleTemplatesystem(gamesystem: Gamesystem<any, any>) {
if(!this.isTemplateSystemCharacterSpecific(gamesystem.componentName)) {
if(gamesystem instanceof SimpleTemplateGamesystem) {
this.characterSpecificTemplateSystems.push(gamesystem)
gamesystem.addTemplateElement(this)
} else if(gamesystem instanceof ProductTemplateSystem) {
this.characterSpecificTemplateSystems.push(gamesystem)
gamesystem.addTemplateElement(this)
gamesystem.innerGamesystems.forEach(innerGamesystem => this.addCharacterSpecificSimpleTemplatesystem(innerGamesystem))
}
if(gamesystem.parentGamesystem != undefined) {
this.addCharacterSpecificSimpleTemplatesystem(gamesystem.parentGamesystem)
}
}
}