template-systems #41
@ -45,6 +45,7 @@ export class GamesystemParser {
|
||||
let simpleGamesystem
|
||||
if(gamesystemData.templateType != undefined) {
|
||||
simpleGamesystem = new SimpleTemplateGamesystem(gamesystemData.componentName, gamesystemData.componentDescription, gamesystemData.templateType)
|
||||
simpleGamesystem.symmetric = gamesystemData.symmetric
|
||||
} else {
|
||||
simpleGamesystem = new SimpleGamesystem(gamesystemData.componentName, gamesystemData.componentDescription)
|
||||
}
|
||||
@ -56,6 +57,7 @@ export class GamesystemParser {
|
||||
const transitionParser = new TransitionParser(simpleGamesystem.states, this.scriptAccounts)
|
||||
simpleGamesystem.transitions = transitionParser.parseTransitions(gamesystemData.transitions, gamesystemData.templateType)
|
||||
|
||||
simpleGamesystem.generateIsolatedStates = gamesystemData.generateIsolatedStates;
|
||||
|
||||
return simpleGamesystem
|
||||
}
|
||||
@ -66,8 +68,11 @@ export class GamesystemParser {
|
||||
productGamesystem = new ProductGamesystem(gamesystemData.componentName, gamesystemData.componentDescription);
|
||||
} else {
|
||||
productGamesystem = new ProductTemplateSystem(gamesystemData.componentName, gamesystemData.componentDescription, gamesystemData.templateType)
|
||||
productGamesystem.symmetric = gamesystemData.symmetric
|
||||
}
|
||||
|
||||
productGamesystem.generateIsolatedStates = gamesystemData.generateIsolatedStates
|
||||
|
||||
const childsystemNames: string[] = []
|
||||
for(let i=0; i<gamesystemData.childsystems.length; i++) {
|
||||
childsystemNames.push(gamesystemData.childsystems[i].componentName)
|
||||
|
@ -66,13 +66,16 @@ export class GamesystemSerializer {
|
||||
'componentName': productGamesystem.componentName,
|
||||
'componentDescription': productGamesystem.componentDescription,
|
||||
'childsystems': innerGamesystemJsonArray,
|
||||
'templateType': productGamesystem.templateType
|
||||
'templateType': productGamesystem.templateType,
|
||||
'symmetric': productGamesystem.symmetric,
|
||||
'generateIsolatedStates':productGamesystem.generateIsolatedStates
|
||||
}
|
||||
} else {
|
||||
jsonString = {
|
||||
'componentName': productGamesystem.componentName,
|
||||
'componentDescription': productGamesystem.componentDescription,
|
||||
'childsystems': innerGamesystemJsonArray,
|
||||
'generateIsolatedStates':productGamesystem.generateIsolatedStates
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
"componentDescription": "",
|
||||
"states": [
|
||||
{
|
||||
"initial": false,
|
||||
"initial": true,
|
||||
"conditions": [],
|
||||
"stateLabel": "Feind",
|
||||
"stateDescription": ""
|
||||
|
14
testModel/gamesystems/ProductGamesystem/Letter.json
Normal file
14
testModel/gamesystems/ProductGamesystem/Letter.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"componentName": "Letter",
|
||||
"componentDescription": "",
|
||||
"states": [
|
||||
{
|
||||
"initial": false,
|
||||
"conditions": [],
|
||||
"stateLabel": "A",
|
||||
"stateDescription": ""
|
||||
}
|
||||
],
|
||||
"transitions": [],
|
||||
"generateIsolatedStates": false
|
||||
}
|
14
testModel/gamesystems/ProductGamesystem/Number.json
Normal file
14
testModel/gamesystems/ProductGamesystem/Number.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"componentName": "Number",
|
||||
"componentDescription": "",
|
||||
"states": [
|
||||
{
|
||||
"initial": false,
|
||||
"conditions": [],
|
||||
"stateLabel": "1",
|
||||
"stateDescription": ""
|
||||
}
|
||||
],
|
||||
"transitions": [],
|
||||
"generateIsolatedStates": false
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
{
|
||||
"componentName": "ProductGamesystem",
|
||||
"componentDescription": "",
|
||||
"childsystems": [
|
||||
{
|
||||
"componentName": "Letter"
|
||||
},
|
||||
{
|
||||
"componentName": "Number"
|
||||
}
|
||||
],
|
||||
"generateIsolatedStates": true
|
||||
}
|
6
testModel/script-accounts/Test.json
Normal file
6
testModel/script-accounts/Test.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"componentName": "Test",
|
||||
"componentDescription": "",
|
||||
"minValue": 0,
|
||||
"maxValue": 100
|
||||
}
|
Loading…
Reference in New Issue
Block a user