Add Hierarchy as Template when one member of hierarchy is added
All checks were successful
E2E Testing / test (push) Successful in 1m34s
All checks were successful
E2E Testing / test (push) Successful in 1m34s
This commit is contained in:
parent
c9bb367f4e
commit
225d6ab43c
@ -1,9 +1,9 @@
|
|||||||
import {ModelComponent} from "../ModelComponent";
|
import {ModelComponent} from "../ModelComponent";
|
||||||
import {ModelComponentType} from "../ModelComponentType";
|
import {ModelComponentType} from "../ModelComponentType";
|
||||||
import {SimpleTemplateGamesystem} from "../gamesystems/SimpleTemplateGamesystem";
|
import {SimpleTemplateGamesystem} from "../gamesystems/SimpleTemplateGamesystem";
|
||||||
import {TemplateGamesystem} from "../gamesystems/TemplateGamesystem";
|
|
||||||
import {ProductTemplateSystem} from "../gamesystems/ProductTemplateSystem";
|
import {ProductTemplateSystem} from "../gamesystems/ProductTemplateSystem";
|
||||||
import {Gamesystem} from "../gamesystems/Gamesystem";
|
import {Gamesystem} from "../gamesystems/Gamesystem";
|
||||||
|
import {TemplateType} from "../TemplateType";
|
||||||
|
|
||||||
export class Character extends ModelComponent{
|
export class Character extends ModelComponent{
|
||||||
|
|
||||||
@ -16,6 +16,17 @@ export class Character extends ModelComponent{
|
|||||||
addCharacterSpecificGamesystem(templateGamesystem: SimpleTemplateGamesystem<Character> | ProductTemplateSystem<Character>) {
|
addCharacterSpecificGamesystem(templateGamesystem: SimpleTemplateGamesystem<Character> | ProductTemplateSystem<Character>) {
|
||||||
if(!this.isGamesystemCharacterSpecific(templateGamesystem.componentName)) {
|
if(!this.isGamesystemCharacterSpecific(templateGamesystem.componentName)) {
|
||||||
this.characterSpecificGamesystems.push(templateGamesystem);
|
this.characterSpecificGamesystems.push(templateGamesystem);
|
||||||
|
if(templateGamesystem instanceof ProductTemplateSystem){
|
||||||
|
templateGamesystem.innerGamesystems.forEach(innerSystem => {
|
||||||
|
if(innerSystem instanceof SimpleTemplateGamesystem && innerSystem.templateType == TemplateType.CHARACTER) {
|
||||||
|
this.addCharacterSpecificGamesystem(innerSystem)
|
||||||
|
} else if(innerSystem instanceof ProductTemplateSystem && innerSystem.templateType == TemplateType.CHARACTER) {
|
||||||
|
this.addCharacterSpecificGamesystem(innerSystem)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else if(templateGamesystem.parentGamesystem != undefined && templateGamesystem.parentGamesystem instanceof ProductTemplateSystem) {
|
||||||
|
this.addCharacterSpecificGamesystem(templateGamesystem.parentGamesystem)
|
||||||
|
}
|
||||||
templateGamesystem.addReferenceKey(this);
|
templateGamesystem.addReferenceKey(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user