template-systems #41

Merged
sebastian merged 30 commits from template-systems into main 2024-04-19 21:10:01 +02:00
7 changed files with 57 additions and 2 deletions
Showing only changes of commit 743af8c0a1 - Show all commits

View File

@ -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)

View File

@ -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
}
}

View File

@ -3,7 +3,7 @@
"componentDescription": "",
"states": [
{
"initial": false,
"initial": true,
"conditions": [],
"stateLabel": "Feind",
"stateDescription": ""

View File

@ -0,0 +1,14 @@
{
"componentName": "Letter",
"componentDescription": "",
"states": [
{
"initial": false,
"conditions": [],
"stateLabel": "A",
"stateDescription": ""
}
],
"transitions": [],
"generateIsolatedStates": false
}

View File

@ -0,0 +1,14 @@
{
"componentName": "Number",
"componentDescription": "",
"states": [
{
"initial": false,
"conditions": [],
"stateLabel": "1",
"stateDescription": ""
}
],
"transitions": [],
"generateIsolatedStates": false
}

View File

@ -0,0 +1,13 @@
{
"componentName": "ProductGamesystem",
"componentDescription": "",
"childsystems": [
{
"componentName": "Letter"
},
{
"componentName": "Number"
}
],
"generateIsolatedStates": true
}

View File

@ -0,0 +1,6 @@
{
"componentName": "Test",
"componentDescription": "",
"minValue": 0,
"maxValue": 100
}