From e0332433892e414070630fe751ef6263a543cb66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Mon, 18 Mar 2024 16:33:39 +0100 Subject: [PATCH] Store conditions and simplify condition reference to component-name --- ...iptaccount-condition-editor.component.html | 2 +- src/app/game-model/fs/store/StoreProject.ts | 4 +++ testModel/gamesystems/Weather.json | 35 +++++++++++++++++-- 3 files changed, 38 insertions(+), 3 deletions(-) diff --git a/src/app/editor/gamesystem-editor/scriptaccount-condition-editor/scriptaccount-condition-editor.component.html b/src/app/editor/gamesystem-editor/scriptaccount-condition-editor/scriptaccount-condition-editor.component.html index 0ddb8f5..0cad14c 100644 --- a/src/app/editor/gamesystem-editor/scriptaccount-condition-editor/scriptaccount-condition-editor.component.html +++ b/src/app/editor/gamesystem-editor/scriptaccount-condition-editor/scriptaccount-condition-editor.component.html @@ -37,7 +37,7 @@ - + diff --git a/src/app/game-model/fs/store/StoreProject.ts b/src/app/game-model/fs/store/StoreProject.ts index 6503281..ce3e0bb 100644 --- a/src/app/game-model/fs/store/StoreProject.ts +++ b/src/app/game-model/fs/store/StoreProject.ts @@ -53,6 +53,10 @@ export class StoreProject { return value.stateLabel } + if(key === "scriptAccount") { + return value.componentName + } + if(key === 'incomingTransitions' || key === 'outgoingTransitions' || key === 'unsaved' || key === 'type') { return undefined; } else { diff --git a/testModel/gamesystems/Weather.json b/testModel/gamesystems/Weather.json index 53d81f8..cf34e7b 100644 --- a/testModel/gamesystems/Weather.json +++ b/testModel/gamesystems/Weather.json @@ -4,10 +4,41 @@ "states": [ { "initial": false, - "conditions": [], + "conditions": [ + { + "scriptAccount": "Luftfeuchtigkeit", + "minValue": 0, + "maxValue": "50" + } + ], "stateLabel": "Sonnig", "stateDescription": "Die Sonne scheint" + }, + { + "initial": false, + "conditions": [ + { + "scriptAccount": "Luftfeuchtigkeit", + "minValue": "50", + "maxValue": "75" + } + ], + "stateLabel": "Wolkig", + "stateDescription": "" } ], - "transitions": [] + "transitions": [ + { + "scriptAccountActions": [], + "scriptAccountConditions": [ + { + "scriptAccount": "Luftfeuchtigkeit", + "minValue": "50", + "maxValue": "75" + } + ], + "startingState": "Sonnig", + "endingState": "Wolkig" + } + ] } \ No newline at end of file