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 => {
|
this.transitions.forEach(transition => {
|
||||||
if(!transition.conditions.has(reference)) {
|
if(!transition.conditionMap.has(reference)) {
|
||||||
transition.conditions.set(reference, transition.scriptAccountConditions.concat())
|
transition.conditionMap.set(reference, transition.scriptAccountConditions.concat())
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!transition.actions.has(reference)) {
|
if(!transition.actionMap.has(reference)) {
|
||||||
transition.actions.set(reference, transition.scriptAccountActions.concat())
|
transition.actionMap.set(reference, transition.scriptAccountActions.concat())
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,6 @@ import {ScriptAccountAction} from "../actions/ScriptAccountAction";
|
|||||||
|
|
||||||
export class SimpleTemplateTransition<ReferenceType> extends SimpleTransition {
|
export class SimpleTemplateTransition<ReferenceType> extends SimpleTransition {
|
||||||
|
|
||||||
conditions: Map<ReferenceType, ScriptAccountCondition[]> = new Map();
|
conditionMap: Map<ReferenceType, ScriptAccountCondition[]> = new Map();
|
||||||
actions: Map<ReferenceType, ScriptAccountAction[]> = new Map();
|
actionMap: Map<ReferenceType, ScriptAccountAction[]> = new Map();
|
||||||
}
|
}
|
||||||
|
@ -30,10 +30,17 @@ export class CharacterSerializer {
|
|||||||
return value.componentName
|
return value.componentName
|
||||||
}
|
}
|
||||||
|
|
||||||
if(key === 'conditionMap') {
|
if(key === 'conditionMap' || key === 'actionMap') {
|
||||||
|
if(value.get(character) == undefined) {
|
||||||
|
return []
|
||||||
|
}
|
||||||
return value.get(character)
|
return value.get(character)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(key === 'startingState' || key === 'endingState') {
|
||||||
|
return value.stateLabel
|
||||||
|
}
|
||||||
|
|
||||||
if(this.ignoredKeys.includes(key)) {
|
if(this.ignoredKeys.includes(key)) {
|
||||||
return undefined
|
return undefined
|
||||||
} else {
|
} else {
|
||||||
|
@ -24,21 +24,10 @@
|
|||||||
{
|
{
|
||||||
"scriptAccountActions": [],
|
"scriptAccountActions": [],
|
||||||
"scriptAccountConditions": [],
|
"scriptAccountConditions": [],
|
||||||
"startingState": {
|
"startingState": "Fröhlich",
|
||||||
"stateLabel": "Fröhlich",
|
"endingState": "Wütend",
|
||||||
"conditionMap": [
|
"conditionMap": [],
|
||||||
{
|
"actionMap": []
|
||||||
"scriptAccount": "Luftfeuchtigkeit",
|
|
||||||
"minValue": 0,
|
|
||||||
"maxValue": "10"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"endingState": {
|
|
||||||
"stateLabel": "Wütend",
|
|
||||||
"conditionMap": []
|
|
||||||
},
|
|
||||||
"actions": {}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -21,8 +21,7 @@
|
|||||||
"scriptAccountConditions": [],
|
"scriptAccountConditions": [],
|
||||||
"startingState": "Fröhlich",
|
"startingState": "Fröhlich",
|
||||||
"endingState": "Wütend",
|
"endingState": "Wütend",
|
||||||
"conditions": {},
|
"actionMap": {}
|
||||||
"actions": {}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"templateType": 1
|
"templateType": 1
|
||||||
|
Loading…
Reference in New Issue
Block a user