CharacterSpecific Templatesystems #36

Merged
sebastian merged 31 commits from template-systems into main 2024-04-14 13:45:04 +02:00
3 changed files with 25 additions and 18 deletions
Showing only changes of commit c1070ed1ff - Show all commits

View File

@ -7,8 +7,10 @@ export class SimpleTemplateState extends SimpleState {
conditionMap: Map<TemplateElement, ScriptAccountCondition[]> = new Map();
addTemplateElement(templateElement: TemplateElement) {
if(!this.conditionMap.has(templateElement)) {
this.conditionMap.set(templateElement, this.conditions)
}
}
removeTemplateElement(templateElement: TemplateElement) {
this.conditionMap.delete(templateElement)

View File

@ -8,10 +8,16 @@ export class SimpleTemplateTransition extends SimpleTransition{
actionMap: Map<TemplateElement, ScriptAccountAction[]> = new Map();
addTemplateElement(templateElement: TemplateElement) {
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) {
this.conditionMap.delete(templateElement)
this.actionMap.delete(templateElement)

View File

@ -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": [],