From 87a0dd775e50f70172fd283f70c39c05953941cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Fri, 19 Apr 2024 17:50:03 +0200 Subject: [PATCH] Generate isolated states only on demand --- .../product-gamesystem-editor.component.html | 1 + .../project/game-model/gamesystems/ProductGamesystem.ts | 7 +++++-- .../templates/productGamesystem/ProductTemplateSystem.ts | 8 ++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/app/editor/gamesystem-editor/product-gamesystem-editor/product-gamesystem-editor.component.html b/src/app/editor/gamesystem-editor/product-gamesystem-editor/product-gamesystem-editor.component.html index 0eee76f..fde7130 100644 --- a/src/app/editor/gamesystem-editor/product-gamesystem-editor/product-gamesystem-editor.component.html +++ b/src/app/editor/gamesystem-editor/product-gamesystem-editor/product-gamesystem-editor.component.html @@ -1,3 +1,4 @@ +Generate Isolated States
diff --git a/src/app/project/game-model/gamesystems/ProductGamesystem.ts b/src/app/project/game-model/gamesystems/ProductGamesystem.ts index eade33e..00889a5 100644 --- a/src/app/project/game-model/gamesystems/ProductGamesystem.ts +++ b/src/app/project/game-model/gamesystems/ProductGamesystem.ts @@ -16,6 +16,7 @@ import {IsolatedProductStateGenerator} from "./productSystemGenerator/IsolatedPr export class ProductGamesystem extends Gamesystem { innerGamesystems: Gamesystem, Transition>[] = []; + generateIsolatedStates: boolean = false static constructFromSimpleGamesystem(simpleGamesystem: SimpleGamesystem, gameModel: GameModel) { const productGamesystem = new ProductGamesystem(simpleGamesystem.componentName, simpleGamesystem.componentDescription); @@ -76,8 +77,10 @@ export class ProductGamesystem extends Gamesystem, Transition>) { diff --git a/src/app/project/game-model/templates/productGamesystem/ProductTemplateSystem.ts b/src/app/project/game-model/templates/productGamesystem/ProductTemplateSystem.ts index 1e5a9da..62816c4 100644 --- a/src/app/project/game-model/templates/productGamesystem/ProductTemplateSystem.ts +++ b/src/app/project/game-model/templates/productGamesystem/ProductTemplateSystem.ts @@ -32,10 +32,14 @@ export class ProductTemplateSystem extends ProductGamesystem implements Template } else { const productTemplateGenerator = new TemplateProductSystemGenerator(this, templateElement); productTemplateGenerator.generateFromChildsystems() + + if(this.generateIsolatedStates) { + const isolatedTemplateStateGenerator = new IsolatedTemplateStateGenerator(this, templateElement); + isolatedTemplateStateGenerator.generateIsolatedProductStates(); + } } - const isolatedTemplateStateGenerator = new IsolatedTemplateStateGenerator(this, templateElement); - isolatedTemplateStateGenerator.generateIsolatedProductStates(); + } }