diff --git a/src/app/editor/gamesystem-editor/gamesystem-editor.component.html b/src/app/editor/gamesystem-editor/gamesystem-editor.component.html index f4ef23b..c32d36c 100644 --- a/src/app/editor/gamesystem-editor/gamesystem-editor.component.html +++ b/src/app/editor/gamesystem-editor/gamesystem-editor.component.html @@ -1,3 +1,6 @@ +
+ Gamesystem is symmetric template +
diff --git a/src/app/editor/gamesystem-editor/gamesystem-editor.component.ts b/src/app/editor/gamesystem-editor/gamesystem-editor.component.ts index 2174be0..907935a 100644 --- a/src/app/editor/gamesystem-editor/gamesystem-editor.component.ts +++ b/src/app/editor/gamesystem-editor/gamesystem-editor.component.ts @@ -6,6 +6,8 @@ import {ScriptAccount} from "../../project/game-model/scriptAccounts/ScriptAccou import {SimpleGamesystem} from "../../project/game-model/gamesystems/SimpleGamesystem"; import {ProductGamesystem} from "../../project/game-model/gamesystems/ProductGamesystem"; import {TemplateElement} from "../../project/game-model/templates/TemplateElement"; +import {SimpleTemplateGamesystem} from "../../project/game-model/templates/simpleGamesystem/SimpleTemplateGamesystem"; +import {ProductTemplateSystem} from "../../project/game-model/templates/productGamesystem/ProductTemplateSystem"; @Component({ selector: 'app-gamesystem-editor', @@ -42,4 +44,19 @@ export class GamesystemEditorComponent implements OnInit{ onOpenGamesystemEditor(gamesystem: SimpleGamesystem) { this.openGamesystemEmitter.emit(gamesystem); } + + isGamesystemTemplate() { + return this.gamesystem instanceof SimpleTemplateGamesystem || this.gamesystem instanceof ProductTemplateSystem; + } + + convertGamesystemToTemplate(gamesystem: Gamesystem, Transition> | undefined) { + if(gamesystem instanceof SimpleTemplateGamesystem) { + return gamesystem as SimpleTemplateGamesystem; + } else if(gamesystem instanceof ProductTemplateSystem) { + return gamesystem as ProductTemplateSystem + } else { + return undefined + } + + } } diff --git a/src/app/project/game-model/templates/productGamesystem/ProductTemplateSystem.ts b/src/app/project/game-model/templates/productGamesystem/ProductTemplateSystem.ts index e6957fd..02a50ce 100644 --- a/src/app/project/game-model/templates/productGamesystem/ProductTemplateSystem.ts +++ b/src/app/project/game-model/templates/productGamesystem/ProductTemplateSystem.ts @@ -13,6 +13,7 @@ export class ProductTemplateSystem extends ProductGamesystem implements Template stateMap: Map = new Map(); transitionMap: Map = new Map() templateType: TemplateType + symmetric: boolean = false constructor(gamesystemName: string, gamesystemDescription: string, templateType: TemplateType) { diff --git a/src/app/project/game-model/templates/simpleGamesystem/SimpleTemplateGamesystem.ts b/src/app/project/game-model/templates/simpleGamesystem/SimpleTemplateGamesystem.ts index 17856d2..0c844f4 100644 --- a/src/app/project/game-model/templates/simpleGamesystem/SimpleTemplateGamesystem.ts +++ b/src/app/project/game-model/templates/simpleGamesystem/SimpleTemplateGamesystem.ts @@ -10,6 +10,7 @@ import {TemplateType} from "../TemplateType"; export class SimpleTemplateGamesystem extends SimpleGamesystem implements TemplateGamesystem { templateType: TemplateType + symmetric: boolean = true constructor(gamesystemName: string, gamesystemDescription: string, templateType: TemplateType) { super(gamesystemName, gamesystemDescription); diff --git a/testModel/characters/Hicks Haddock.json b/testModel/characters/Hicks Haddock.json index 414d072..debd75a 100644 --- a/testModel/characters/Hicks Haddock.json +++ b/testModel/characters/Hicks Haddock.json @@ -44,7 +44,8 @@ "conditionMap": [], "actionMap": [] } - ] + ], + "symmetric": true } ] } \ No newline at end of file diff --git a/testModel/gamesystems/Characterbeziehungssystem.json b/testModel/gamesystems/Characterbeziehungssystem.json index 66d038b..ad1b1b4 100644 --- a/testModel/gamesystems/Characterbeziehungssystem.json +++ b/testModel/gamesystems/Characterbeziehungssystem.json @@ -47,5 +47,6 @@ "endingState": "Feind" } ], + "symmetric": true, "templateType": 1 } \ No newline at end of file