product-template-systems #33

Merged
sebastian merged 8 commits from product-template-systems into template-systems 2024-04-14 11:45:39 +02:00
4 changed files with 34 additions and 1 deletions
Showing only changes of commit 10a32df859 - Show all commits

View File

@ -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<gamesystemData.childsystems.length; i++) {
childsystemNames.push(gamesystemData.childsystems[i].componentName)

View File

@ -0,0 +1,7 @@
{
"componentName": "Letters",
"componentDescription": "",
"states": [],
"transitions": [],
"templateType": 0
}

View File

@ -0,0 +1,6 @@
{
"componentName": "Numbers",
"componentDescription": "",
"states": [],
"transitions": []
}

View File

@ -0,0 +1,13 @@
{
"componentName": "Producttest",
"componentDescription": "",
"childsystems": [
{
"componentName": "Letters"
},
{
"componentName": "Numbers"
}
],
"templateType": 0
}