From 66697ced00ff03a5a7ce90b1e24a3840f91f38e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Sat, 13 Apr 2024 06:55:21 +0200 Subject: [PATCH] Consider SimpleTemplateSystem implementation when calculating leafGamesystems --- .../product-gamesystem-editor/LeafGamesystemCalculator.ts | 4 +++- testModel/characters/New Character.json | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 testModel/characters/New Character.json diff --git a/src/app/editor/gamesystem-editor/product-gamesystem-editor/LeafGamesystemCalculator.ts b/src/app/editor/gamesystem-editor/product-gamesystem-editor/LeafGamesystemCalculator.ts index 2d0c7d0..bebc1d7 100644 --- a/src/app/editor/gamesystem-editor/product-gamesystem-editor/LeafGamesystemCalculator.ts +++ b/src/app/editor/gamesystem-editor/product-gamesystem-editor/LeafGamesystemCalculator.ts @@ -4,15 +4,17 @@ import {ProductGamesystem} from "../../../project/game-model/gamesystems/Product import {State} from "../../../project/game-model/gamesystems/states/State"; import {SimpleState} from "../../../project/game-model/gamesystems/states/SimpleState"; import {ProductState} from "../../../project/game-model/gamesystems/states/ProductState"; +import {SimpleTemplateGamesystem} from "../../../project/game-model/gamesystems/SimpleTemplateGamesystem"; export class LeafGamesystemCalculator { static calcLeafGeamesystems(gamesystem: Gamesystem) { - if(gamesystem instanceof SimpleGamesystem) { + if(gamesystem instanceof SimpleGamesystem || gamesystem instanceof SimpleTemplateGamesystem) { return [gamesystem]; } else { const product_gamesystem = gamesystem as ProductGamesystem; const leaf_gamesystems: SimpleGamesystem[] = []; + console.log(product_gamesystem) product_gamesystem.innerGamesystems.forEach(innerGamesystem => { LeafGamesystemCalculator.calcLeafGeamesystems(innerGamesystem).forEach(leafGamesystem => leaf_gamesystems.push(leafGamesystem)) }) diff --git a/testModel/characters/New Character.json b/testModel/characters/New Character.json new file mode 100644 index 0000000..d97eee6 --- /dev/null +++ b/testModel/characters/New Character.json @@ -0,0 +1,5 @@ +{ + "componentName": "New Character", + "componentDescription": "", + "characterSpecificGamesystems": [] +} \ No newline at end of file