diff --git a/src/app/game-model/fs/ProcessLoadedProject.ts b/src/app/game-model/fs/ProcessLoadedProject.ts index 0d379df..b6fe4d1 100644 --- a/src/app/game-model/fs/ProcessLoadedProject.ts +++ b/src/app/game-model/fs/ProcessLoadedProject.ts @@ -8,15 +8,26 @@ import {SimpleGamesystemParser} from "./parser/SimpleGamesystemParser"; import {SimpleGamesystem} from "../gamesystems/SimpleGamesystem"; import {ProductGamesystem} from "../gamesystems/ProductGamesystem"; import {ProductGamesystemParser} from "./parser/ProductGamesystemParser"; +import {Gamesystem} from "../gamesystems/Gamesystem"; export class ProcessLoadedProject { static processLoadedProject(loadedProject: LoadedProject): GameModel { const gameModel = new GameModel(loadedProject.projectName); loadedProject.loadedModels.forEach(loadedModel => this.processLoadedModel(gameModel, loadedModel)) + //Generate product Gamesystems + this.generateProductGamesystems(gameModel.gamesystems) return gameModel; } + static generateProductGamesystems(gamesystems: Gamesystem[]) { + gamesystems.forEach(gamesystem => { + if(gamesystem instanceof ProductGamesystem) { + gamesystem.generateFromChildsystems(); + } + }) + } + static processLoadedModel(gameModel: GameModel, loadedModel: LoadModel) { switch (loadedModel.modelType) { case ModelComponentType.SCRIPTACCOUNT: this.processLoadedScriptAccount(gameModel, loadedModel); break; diff --git a/src/app/game-model/gamesystems/ProductGamesystem.ts b/src/app/game-model/gamesystems/ProductGamesystem.ts index b81b194..7795942 100644 --- a/src/app/game-model/gamesystems/ProductGamesystem.ts +++ b/src/app/game-model/gamesystems/ProductGamesystem.ts @@ -65,10 +65,25 @@ export class ProductGamesystem extends Gamesystem[] = [this.innerGamesystems[0], this.innerGamesystems[1]]; + if(this.innerGamesystems[0] instanceof ProductGamesystem) { + this.innerGamesystems[0].generateFromChildsystems(); + } + + if(this.innerGamesystems[1] instanceof ProductGamesystem) { + this.innerGamesystems[1].generateFromChildsystems(); + } let gamesystem: ProductGamesystem = ProductGamesystem.generateFromChildsystems(this.innerGamesystems[0], this.innerGamesystems[1], false, integratedSystems); for(let i=2; i