From 10a32df8591d7291347b43fc6edf92864d42a77d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Sun, 14 Apr 2024 11:20:36 +0200 Subject: [PATCH] Load Templatetype of ProductTemplateGamesystems --- .../parser/gamesystemParser/GamesystemParser.ts | 9 ++++++++- testModel/gamesystems/Producttest/Letters.json | 7 +++++++ testModel/gamesystems/Producttest/Numbers.json | 6 ++++++ testModel/gamesystems/Producttest/Producttest.json | 13 +++++++++++++ 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 testModel/gamesystems/Producttest/Letters.json create mode 100644 testModel/gamesystems/Producttest/Numbers.json create mode 100644 testModel/gamesystems/Producttest/Producttest.json diff --git a/src/app/project/parser/gamesystemParser/GamesystemParser.ts b/src/app/project/parser/gamesystemParser/GamesystemParser.ts index 564d4ce..0e4ce93 100644 --- a/src/app/project/parser/gamesystemParser/GamesystemParser.ts +++ b/src/app/project/parser/gamesystemParser/GamesystemParser.ts @@ -7,6 +7,7 @@ import {StateParser} from "./StateParser"; import {ScriptAccount} from "../../game-model/scriptAccounts/ScriptAccount"; import {TransitionParser} from "./TransitionParser"; import {SimpleTemplateGamesystem} from "../../game-model/templates/simpleGamesystem/SimpleTemplateGamesystem"; +import {ProductTemplateSystem} from "../../game-model/templates/productGamesystem/ProductTemplateSystem"; export class GamesystemParser { @@ -60,7 +61,13 @@ export class GamesystemParser { } parseProductGamesystem(gamesystemData: any) { - const productGamesystem = new ProductGamesystem(gamesystemData.componentName, gamesystemData.componentDescription); + let productGamesystem; + if(gamesystemData.templateType == undefined) { + productGamesystem = new ProductGamesystem(gamesystemData.componentName, gamesystemData.componentDescription); + } else { + productGamesystem = new ProductTemplateSystem(gamesystemData.componentName, gamesystemData.componentDescription, gamesystemData.templateType) + } + const childsystemNames: string[] = [] for(let i=0; i