From 7acf334db9d067953aa24465cc37e1c9f597186e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Sat, 13 Apr 2024 07:47:04 +0200 Subject: [PATCH] Pass TemplateReference to ProductState and productTransition Editor --- .../gamesystem-editor.component.html | 2 +- .../product-gamesystem-editor.component.html | 4 +- .../product-gamesystem-editor.component.ts | 2 + testModel/characters/New Character.json | 44 +++++++++++++++++-- .../ProductTemplate/SimpleTemplate 1.json | 25 ++++++++++- .../ProductTemplate/SimpleTemplate 2.json | 25 ++++++++++- 6 files changed, 91 insertions(+), 11 deletions(-) diff --git a/src/app/editor/gamesystem-editor/gamesystem-editor.component.html b/src/app/editor/gamesystem-editor/gamesystem-editor.component.html index 229e455..46624fe 100644 --- a/src/app/editor/gamesystem-editor/gamesystem-editor.component.html +++ b/src/app/editor/gamesystem-editor/gamesystem-editor.component.html @@ -1,4 +1,4 @@ + (onOpenGamesystemEditor)="onOpenGamesystemEditor($event)" [templateReference]="templateReference"> diff --git a/src/app/editor/gamesystem-editor/product-gamesystem-editor/product-gamesystem-editor.component.html b/src/app/editor/gamesystem-editor/product-gamesystem-editor/product-gamesystem-editor.component.html index b2d1a1f..98e42fe 100644 --- a/src/app/editor/gamesystem-editor/product-gamesystem-editor/product-gamesystem-editor.component.html +++ b/src/app/editor/gamesystem-editor/product-gamesystem-editor/product-gamesystem-editor.component.html @@ -1,4 +1,4 @@ - +
- +
diff --git a/src/app/editor/gamesystem-editor/product-gamesystem-editor/product-gamesystem-editor.component.ts b/src/app/editor/gamesystem-editor/product-gamesystem-editor/product-gamesystem-editor.component.ts index d1f7f23..08c8343 100644 --- a/src/app/editor/gamesystem-editor/product-gamesystem-editor/product-gamesystem-editor.component.ts +++ b/src/app/editor/gamesystem-editor/product-gamesystem-editor/product-gamesystem-editor.component.ts @@ -4,6 +4,7 @@ import { } from "../transition-editor/product-transition-editor/product-transition-editor.component"; import {ProductGamesystem} from "../../../project/game-model/gamesystems/ProductGamesystem"; import {SimpleGamesystem} from "../../../project/game-model/gamesystems/SimpleGamesystem"; +import {Character} from "../../../project/game-model/characters/Character"; @@ -15,6 +16,7 @@ import {SimpleGamesystem} from "../../../project/game-model/gamesystems/SimpleGa export class ProductGamesystemEditorComponent { @Input() gamesystem: ProductGamesystem | undefined + @Input() templateReference: Character | undefined @Output("onOpenGamesystemEditor") openGamesystemEditorEmitter = new EventEmitter(); onOpenGamesystemEditor(gamesystem: SimpleGamesystem) { diff --git a/testModel/characters/New Character.json b/testModel/characters/New Character.json index ca7cd7e..8e15e5e 100644 --- a/testModel/characters/New Character.json +++ b/testModel/characters/New Character.json @@ -4,13 +4,49 @@ "characterSpecificGamesystems": [ { "componentName": "SimpleTemplate 1", - "states": [], - "transitions": [] + "states": [ + { + "stateLabel": "1", + "conditionMap": [] + }, + { + "stateLabel": "2", + "conditionMap": [] + } + ], + "transitions": [ + { + "scriptAccountActions": [], + "scriptAccountConditions": [], + "startingState": "1", + "endingState": "2", + "conditionMap": [], + "actionMap": [] + } + ] }, { "componentName": "SimpleTemplate 2", - "states": [], - "transitions": [] + "states": [ + { + "stateLabel": "A", + "conditionMap": [] + }, + { + "stateLabel": "B", + "conditionMap": [] + } + ], + "transitions": [ + { + "scriptAccountActions": [], + "scriptAccountConditions": [], + "startingState": "A", + "endingState": "B", + "conditionMap": [], + "actionMap": [] + } + ] } ] } \ No newline at end of file diff --git a/testModel/gamesystems/ProductTemplate/SimpleTemplate 1.json b/testModel/gamesystems/ProductTemplate/SimpleTemplate 1.json index f8435a5..93d355c 100644 --- a/testModel/gamesystems/ProductTemplate/SimpleTemplate 1.json +++ b/testModel/gamesystems/ProductTemplate/SimpleTemplate 1.json @@ -1,7 +1,28 @@ { "componentName": "SimpleTemplate 1", "componentDescription": "", - "states": [], - "transitions": [], + "states": [ + { + "initial": false, + "conditions": [], + "stateLabel": "1", + "stateDescription": "" + }, + { + "initial": false, + "conditions": [], + "stateLabel": "2", + "stateDescription": "" + } + ], + "transitions": [ + { + "scriptAccountActions": [], + "scriptAccountConditions": [], + "startingState": "1", + "endingState": "2", + "actionMap": {} + } + ], "templateType": 1 } \ No newline at end of file diff --git a/testModel/gamesystems/ProductTemplate/SimpleTemplate 2.json b/testModel/gamesystems/ProductTemplate/SimpleTemplate 2.json index f55b0a8..2b10735 100644 --- a/testModel/gamesystems/ProductTemplate/SimpleTemplate 2.json +++ b/testModel/gamesystems/ProductTemplate/SimpleTemplate 2.json @@ -1,7 +1,28 @@ { "componentName": "SimpleTemplate 2", "componentDescription": "", - "states": [], - "transitions": [], + "states": [ + { + "initial": false, + "conditions": [], + "stateLabel": "A", + "stateDescription": "" + }, + { + "initial": false, + "conditions": [], + "stateLabel": "B", + "stateDescription": "" + } + ], + "transitions": [ + { + "scriptAccountActions": [], + "scriptAccountConditions": [], + "startingState": "A", + "endingState": "B", + "actionMap": {} + } + ], "templateType": 1 } \ No newline at end of file