Don't override default conditions/actions when loading character specific gamesystem
All checks were successful
E2E Testing / test (push) Successful in 1m33s
All checks were successful
E2E Testing / test (push) Successful in 1m33s
This commit is contained in:
parent
df3933d147
commit
c1070ed1ff
@ -7,8 +7,10 @@ export class SimpleTemplateState extends SimpleState {
|
|||||||
conditionMap: Map<TemplateElement, ScriptAccountCondition[]> = new Map();
|
conditionMap: Map<TemplateElement, ScriptAccountCondition[]> = new Map();
|
||||||
|
|
||||||
addTemplateElement(templateElement: TemplateElement) {
|
addTemplateElement(templateElement: TemplateElement) {
|
||||||
|
if(!this.conditionMap.has(templateElement)) {
|
||||||
this.conditionMap.set(templateElement, this.conditions)
|
this.conditionMap.set(templateElement, this.conditions)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
removeTemplateElement(templateElement: TemplateElement) {
|
removeTemplateElement(templateElement: TemplateElement) {
|
||||||
this.conditionMap.delete(templateElement)
|
this.conditionMap.delete(templateElement)
|
||||||
|
@ -8,10 +8,16 @@ export class SimpleTemplateTransition extends SimpleTransition{
|
|||||||
actionMap: Map<TemplateElement, ScriptAccountAction[]> = new Map();
|
actionMap: Map<TemplateElement, ScriptAccountAction[]> = new Map();
|
||||||
|
|
||||||
addTemplateElement(templateElement: TemplateElement) {
|
addTemplateElement(templateElement: TemplateElement) {
|
||||||
|
if(!this.conditionMap.has(templateElement)) {
|
||||||
this.conditionMap.set(templateElement, this.scriptAccountConditions.concat())
|
this.conditionMap.set(templateElement, this.scriptAccountConditions.concat())
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!this.actionMap.has(templateElement)) {
|
||||||
this.actionMap.set(templateElement, this.scriptAccountActions.concat())
|
this.actionMap.set(templateElement, this.scriptAccountActions.concat())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
removeTemplateElement(templateElement: TemplateElement) {
|
removeTemplateElement(templateElement: TemplateElement) {
|
||||||
this.conditionMap.delete(templateElement)
|
this.conditionMap.delete(templateElement)
|
||||||
this.actionMap.delete(templateElement)
|
this.actionMap.delete(templateElement)
|
||||||
|
@ -7,28 +7,27 @@
|
|||||||
"states": [
|
"states": [
|
||||||
{
|
{
|
||||||
"stateLabel": "A",
|
"stateLabel": "A",
|
||||||
"conditionMap": []
|
"conditionMap": [
|
||||||
|
{
|
||||||
|
"scriptAccount": "Luftfeuchtigkeit",
|
||||||
|
"minValue": 0,
|
||||||
|
"maxValue": "10"
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"stateLabel": "B",
|
"stateLabel": "B",
|
||||||
"conditionMap": []
|
"conditionMap": [
|
||||||
|
{
|
||||||
|
"scriptAccount": "New ScriptAccount",
|
||||||
|
"minValue": 0,
|
||||||
|
"maxValue": 100
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"transitions": [
|
"transitions": [
|
||||||
{
|
{
|
||||||
"scriptAccountActions": [
|
|
||||||
{
|
|
||||||
"changingValue": 10,
|
|
||||||
"scriptAccount": "Luftfeuchtigkeit"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"scriptAccountConditions": [
|
|
||||||
{
|
|
||||||
"scriptAccount": "Temperature",
|
|
||||||
"minValue": 0,
|
|
||||||
"maxValue": 10
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"startingState": "A",
|
"startingState": "A",
|
||||||
"endingState": "B",
|
"endingState": "B",
|
||||||
"conditionMap": [],
|
"conditionMap": [],
|
||||||
|
Loading…
Reference in New Issue
Block a user