diff --git a/src/app/project/game-model/gamesystems/SimpleTemplateGamesystem.ts b/src/app/project/game-model/gamesystems/SimpleTemplateGamesystem.ts index 992d3f1..4d3cfa0 100644 --- a/src/app/project/game-model/gamesystems/SimpleTemplateGamesystem.ts +++ b/src/app/project/game-model/gamesystems/SimpleTemplateGamesystem.ts @@ -56,12 +56,12 @@ export class SimpleTemplateGamesystem extends Gamesystem { - if(!transition.conditions.has(reference)) { - transition.conditions.set(reference, transition.scriptAccountConditions.concat()) + if(!transition.conditionMap.has(reference)) { + transition.conditionMap.set(reference, transition.scriptAccountConditions.concat()) } - if(!transition.actions.has(reference)) { - transition.actions.set(reference, transition.scriptAccountActions.concat()) + if(!transition.actionMap.has(reference)) { + transition.actionMap.set(reference, transition.scriptAccountActions.concat()) } }) } diff --git a/src/app/project/game-model/gamesystems/transitions/SimpleTemplateTransition.ts b/src/app/project/game-model/gamesystems/transitions/SimpleTemplateTransition.ts index 72d267a..ad66d2a 100644 --- a/src/app/project/game-model/gamesystems/transitions/SimpleTemplateTransition.ts +++ b/src/app/project/game-model/gamesystems/transitions/SimpleTemplateTransition.ts @@ -4,6 +4,6 @@ import {ScriptAccountAction} from "../actions/ScriptAccountAction"; export class SimpleTemplateTransition extends SimpleTransition { - conditions: Map = new Map(); - actions: Map = new Map(); + conditionMap: Map = new Map(); + actionMap: Map = new Map(); } diff --git a/src/app/project/serializer/CharacterSerializer.ts b/src/app/project/serializer/CharacterSerializer.ts index da04fa6..ca38d9b 100644 --- a/src/app/project/serializer/CharacterSerializer.ts +++ b/src/app/project/serializer/CharacterSerializer.ts @@ -30,10 +30,17 @@ export class CharacterSerializer { return value.componentName } - if(key === 'conditionMap') { + if(key === 'conditionMap' || key === 'actionMap') { + if(value.get(character) == undefined) { + return [] + } return value.get(character) } + if(key === 'startingState' || key === 'endingState') { + return value.stateLabel + } + if(this.ignoredKeys.includes(key)) { return undefined } else { diff --git a/testModel/characters/Hicks Haddock.json b/testModel/characters/Hicks Haddock.json index d616330..54fd6be 100644 --- a/testModel/characters/Hicks Haddock.json +++ b/testModel/characters/Hicks Haddock.json @@ -24,21 +24,10 @@ { "scriptAccountActions": [], "scriptAccountConditions": [], - "startingState": { - "stateLabel": "Fröhlich", - "conditionMap": [ - { - "scriptAccount": "Luftfeuchtigkeit", - "minValue": 0, - "maxValue": "10" - } - ] - }, - "endingState": { - "stateLabel": "Wütend", - "conditionMap": [] - }, - "actions": {} + "startingState": "Fröhlich", + "endingState": "Wütend", + "conditionMap": [], + "actionMap": [] } ] } diff --git a/testModel/gamesystems/Characterstimmung.json b/testModel/gamesystems/Characterstimmung.json index 5ef6057..26fca23 100644 --- a/testModel/gamesystems/Characterstimmung.json +++ b/testModel/gamesystems/Characterstimmung.json @@ -21,8 +21,7 @@ "scriptAccountConditions": [], "startingState": "Fröhlich", "endingState": "Wütend", - "conditions": {}, - "actions": {} + "actionMap": {} } ], "templateType": 1