CharacterSpecific Templatesystems #36
@ -7,7 +7,9 @@ export class SimpleTemplateState extends SimpleState {
|
||||
conditionMap: Map<TemplateElement, ScriptAccountCondition[]> = new Map();
|
||||
|
||||
addTemplateElement(templateElement: TemplateElement) {
|
||||
this.conditionMap.set(templateElement, this.conditions)
|
||||
if(!this.conditionMap.has(templateElement)) {
|
||||
this.conditionMap.set(templateElement, this.conditions)
|
||||
}
|
||||
}
|
||||
|
||||
removeTemplateElement(templateElement: TemplateElement) {
|
||||
|
@ -8,8 +8,14 @@ export class SimpleTemplateTransition extends SimpleTransition{
|
||||
actionMap: Map<TemplateElement, ScriptAccountAction[]> = new Map();
|
||||
|
||||
addTemplateElement(templateElement: TemplateElement) {
|
||||
this.conditionMap.set(templateElement, this.scriptAccountConditions.concat())
|
||||
this.actionMap.set(templateElement, this.scriptAccountActions.concat())
|
||||
if(!this.conditionMap.has(templateElement)) {
|
||||
this.conditionMap.set(templateElement, this.scriptAccountConditions.concat())
|
||||
}
|
||||
|
||||
if(!this.actionMap.has(templateElement)) {
|
||||
this.actionMap.set(templateElement, this.scriptAccountActions.concat())
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
removeTemplateElement(templateElement: TemplateElement) {
|
||||
|
@ -7,28 +7,27 @@
|
||||
"states": [
|
||||
{
|
||||
"stateLabel": "A",
|
||||
"conditionMap": []
|
||||
"conditionMap": [
|
||||
{
|
||||
"scriptAccount": "Luftfeuchtigkeit",
|
||||
"minValue": 0,
|
||||
"maxValue": "10"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"stateLabel": "B",
|
||||
"conditionMap": []
|
||||
"conditionMap": [
|
||||
{
|
||||
"scriptAccount": "New ScriptAccount",
|
||||
"minValue": 0,
|
||||
"maxValue": 100
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"transitions": [
|
||||
{
|
||||
"scriptAccountActions": [
|
||||
{
|
||||
"changingValue": 10,
|
||||
"scriptAccount": "Luftfeuchtigkeit"
|
||||
}
|
||||
],
|
||||
"scriptAccountConditions": [
|
||||
{
|
||||
"scriptAccount": "Temperature",
|
||||
"minValue": 0,
|
||||
"maxValue": 10
|
||||
}
|
||||
],
|
||||
"startingState": "A",
|
||||
"endingState": "B",
|
||||
"conditionMap": [],
|
||||
|
Loading…
Reference in New Issue
Block a user