product-template-systems #33
@ -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)
|
||||
|
7
testModel/gamesystems/Producttest/Letters.json
Normal file
7
testModel/gamesystems/Producttest/Letters.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"componentName": "Letters",
|
||||
"componentDescription": "",
|
||||
"states": [],
|
||||
"transitions": [],
|
||||
"templateType": 0
|
||||
}
|
6
testModel/gamesystems/Producttest/Numbers.json
Normal file
6
testModel/gamesystems/Producttest/Numbers.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"componentName": "Numbers",
|
||||
"componentDescription": "",
|
||||
"states": [],
|
||||
"transitions": []
|
||||
}
|
13
testModel/gamesystems/Producttest/Producttest.json
Normal file
13
testModel/gamesystems/Producttest/Producttest.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"componentName": "Producttest",
|
||||
"componentDescription": "",
|
||||
"childsystems": [
|
||||
{
|
||||
"componentName": "Letters"
|
||||
},
|
||||
{
|
||||
"componentName": "Numbers"
|
||||
}
|
||||
],
|
||||
"templateType": 0
|
||||
}
|
Loading…
Reference in New Issue
Block a user