template-systems #41
@ -45,6 +45,7 @@ export class GamesystemParser {
|
|||||||
let simpleGamesystem
|
let simpleGamesystem
|
||||||
if(gamesystemData.templateType != undefined) {
|
if(gamesystemData.templateType != undefined) {
|
||||||
simpleGamesystem = new SimpleTemplateGamesystem(gamesystemData.componentName, gamesystemData.componentDescription, gamesystemData.templateType)
|
simpleGamesystem = new SimpleTemplateGamesystem(gamesystemData.componentName, gamesystemData.componentDescription, gamesystemData.templateType)
|
||||||
|
simpleGamesystem.symmetric = gamesystemData.symmetric
|
||||||
} else {
|
} else {
|
||||||
simpleGamesystem = new SimpleGamesystem(gamesystemData.componentName, gamesystemData.componentDescription)
|
simpleGamesystem = new SimpleGamesystem(gamesystemData.componentName, gamesystemData.componentDescription)
|
||||||
}
|
}
|
||||||
@ -56,6 +57,7 @@ export class GamesystemParser {
|
|||||||
const transitionParser = new TransitionParser(simpleGamesystem.states, this.scriptAccounts)
|
const transitionParser = new TransitionParser(simpleGamesystem.states, this.scriptAccounts)
|
||||||
simpleGamesystem.transitions = transitionParser.parseTransitions(gamesystemData.transitions, gamesystemData.templateType)
|
simpleGamesystem.transitions = transitionParser.parseTransitions(gamesystemData.transitions, gamesystemData.templateType)
|
||||||
|
|
||||||
|
simpleGamesystem.generateIsolatedStates = gamesystemData.generateIsolatedStates;
|
||||||
|
|
||||||
return simpleGamesystem
|
return simpleGamesystem
|
||||||
}
|
}
|
||||||
@ -66,8 +68,11 @@ export class GamesystemParser {
|
|||||||
productGamesystem = new ProductGamesystem(gamesystemData.componentName, gamesystemData.componentDescription);
|
productGamesystem = new ProductGamesystem(gamesystemData.componentName, gamesystemData.componentDescription);
|
||||||
} else {
|
} else {
|
||||||
productGamesystem = new ProductTemplateSystem(gamesystemData.componentName, gamesystemData.componentDescription, gamesystemData.templateType)
|
productGamesystem = new ProductTemplateSystem(gamesystemData.componentName, gamesystemData.componentDescription, gamesystemData.templateType)
|
||||||
|
productGamesystem.symmetric = gamesystemData.symmetric
|
||||||
}
|
}
|
||||||
|
|
||||||
|
productGamesystem.generateIsolatedStates = gamesystemData.generateIsolatedStates
|
||||||
|
|
||||||
const childsystemNames: string[] = []
|
const childsystemNames: string[] = []
|
||||||
for(let i=0; i<gamesystemData.childsystems.length; i++) {
|
for(let i=0; i<gamesystemData.childsystems.length; i++) {
|
||||||
childsystemNames.push(gamesystemData.childsystems[i].componentName)
|
childsystemNames.push(gamesystemData.childsystems[i].componentName)
|
||||||
|
@ -66,13 +66,16 @@ export class GamesystemSerializer {
|
|||||||
'componentName': productGamesystem.componentName,
|
'componentName': productGamesystem.componentName,
|
||||||
'componentDescription': productGamesystem.componentDescription,
|
'componentDescription': productGamesystem.componentDescription,
|
||||||
'childsystems': innerGamesystemJsonArray,
|
'childsystems': innerGamesystemJsonArray,
|
||||||
'templateType': productGamesystem.templateType
|
'templateType': productGamesystem.templateType,
|
||||||
|
'symmetric': productGamesystem.symmetric,
|
||||||
|
'generateIsolatedStates':productGamesystem.generateIsolatedStates
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
jsonString = {
|
jsonString = {
|
||||||
'componentName': productGamesystem.componentName,
|
'componentName': productGamesystem.componentName,
|
||||||
'componentDescription': productGamesystem.componentDescription,
|
'componentDescription': productGamesystem.componentDescription,
|
||||||
'childsystems': innerGamesystemJsonArray,
|
'childsystems': innerGamesystemJsonArray,
|
||||||
|
'generateIsolatedStates':productGamesystem.generateIsolatedStates
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"componentDescription": "",
|
"componentDescription": "",
|
||||||
"states": [
|
"states": [
|
||||||
{
|
{
|
||||||
"initial": false,
|
"initial": true,
|
||||||
"conditions": [],
|
"conditions": [],
|
||||||
"stateLabel": "Feind",
|
"stateLabel": "Feind",
|
||||||
"stateDescription": ""
|
"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