Introduce Symetric and Asymetric Template Relation Systems #40

Merged
sebastian merged 23 commits from assymetric-template-relation-systems into template-systems 2024-04-19 20:04:54 +02:00
Showing only changes of commit 6a711ec579 - Show all commits

View File

@ -43,7 +43,22 @@ export class Character extends ModelComponent implements TemplateElement {
addAsymetricCharacterRelationGamesystem(gamesystem: Gamesystem<any, any>, recursiveCall: boolean = false) { addAsymetricCharacterRelationGamesystem(gamesystem: Gamesystem<any, any>, recursiveCall: boolean = false) {
if(!this.isTemplateSystemCharacterRelationSpecific(gamesystem.componentName)) { if(!this.isTemplateSystemCharacterRelationSpecific(gamesystem.componentName)) {
this.assymetricCharacterRelationSpecificTemplateSystems.push(gamesystem) if(gamesystem instanceof SimpleTemplateGamesystem) {
this.assymetricCharacterRelationSpecificTemplateSystems.push(gamesystem);
gamesystem.addTemplateElement(this);
} else if(gamesystem instanceof ProductTemplateSystem) {
this.characterSpecificTemplateSystems.push(gamesystem);
gamesystem.addTemplateElement(this);
if(!recursiveCall) {
gamesystem.innerGamesystems.forEach(innerGamesystem => this.addAsymetricCharacterRelationGamesystem(innerGamesystem, true))
}
}
if(gamesystem.parentGamesystem != undefined) {
this.addAsymetricCharacterRelationGamesystem(gamesystem.parentGamesystem, true)
}
} }
} }