From bf8324bf16adf5a6b7133df6d601318267caa03e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Sat, 13 Apr 2024 07:40:06 +0200 Subject: [PATCH] Ignore ParentGamesystem in TemplatePersisting --- src/app/project/serializer/CharacterSerializer.ts | 5 +++-- testModel/characters/New Character.json | 13 ++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/app/project/serializer/CharacterSerializer.ts b/src/app/project/serializer/CharacterSerializer.ts index 63af091..8d365ff 100644 --- a/src/app/project/serializer/CharacterSerializer.ts +++ b/src/app/project/serializer/CharacterSerializer.ts @@ -9,7 +9,7 @@ import {SimpleTemplateGamesystem} from "../game-model/gamesystems/SimpleTemplate export class CharacterSerializer { - private static ignoredKeys: string[] = ['unsaved', 'type', 'incomingTransitions', 'outgoingTransitions', 'initial', 'conditions', 'stateDescription', 'templateType'] + private static ignoredKeys: string[] = ['unsaved', 'type', 'incomingTransitions', 'outgoingTransitions', 'initial', 'conditions', 'stateDescription', 'templateType', 'parentGamesystem'] public static serializeCharacters(characters: Character[]): StoreComponent[] { const storedCharacters: StoreComponent[] = [] @@ -26,7 +26,8 @@ export class CharacterSerializer { if(value instanceof Gamesystem) { return { ...value, - componentDescription: undefined + componentDescription: undefined, + parentGamesystem: undefined } } diff --git a/testModel/characters/New Character.json b/testModel/characters/New Character.json index d97eee6..ca7cd7e 100644 --- a/testModel/characters/New Character.json +++ b/testModel/characters/New Character.json @@ -1,5 +1,16 @@ { "componentName": "New Character", "componentDescription": "", - "characterSpecificGamesystems": [] + "characterSpecificGamesystems": [ + { + "componentName": "SimpleTemplate 1", + "states": [], + "transitions": [] + }, + { + "componentName": "SimpleTemplate 2", + "states": [], + "transitions": [] + } + ] } \ No newline at end of file