Serialize Template Transition
All checks were successful
E2E Testing / test (push) Successful in 1m55s
All checks were successful
E2E Testing / test (push) Successful in 1m55s
This commit is contained in:
parent
a3639969e3
commit
5f59726bdd
@ -56,12 +56,12 @@ export class SimpleTemplateGamesystem<ReferenceType> extends Gamesystem<SimpleTe
|
||||
})
|
||||
|
||||
this.transitions.forEach(transition => {
|
||||
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())
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -4,6 +4,6 @@ import {ScriptAccountAction} from "../actions/ScriptAccountAction";
|
||||
|
||||
export class SimpleTemplateTransition<ReferenceType> extends SimpleTransition {
|
||||
|
||||
conditions: Map<ReferenceType, ScriptAccountCondition[]> = new Map();
|
||||
actions: Map<ReferenceType, ScriptAccountAction[]> = new Map();
|
||||
conditionMap: Map<ReferenceType, ScriptAccountCondition[]> = new Map();
|
||||
actionMap: Map<ReferenceType, ScriptAccountAction[]> = new Map();
|
||||
}
|
||||
|
@ -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 {
|
||||
|
@ -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": []
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -21,8 +21,7 @@
|
||||
"scriptAccountConditions": [],
|
||||
"startingState": "Fröhlich",
|
||||
"endingState": "Wütend",
|
||||
"conditions": {},
|
||||
"actions": {}
|
||||
"actionMap": {}
|
||||
}
|
||||
],
|
||||
"templateType": 1
|
||||
|
Loading…
Reference in New Issue
Block a user