template-systems #41

Merged
sebastian merged 30 commits from template-systems into main 2024-04-19 21:10:01 +02:00
6 changed files with 86 additions and 10 deletions
Showing only changes of commit 8521d80881 - Show all commits

View File

@ -10,6 +10,9 @@ export class SimpleTemplateState extends SimpleState {
addTemplateElement(templateElement: TemplateElement) { addTemplateElement(templateElement: TemplateElement) {
if(!this.conditionMap.has(templateElement)) { if(!this.conditionMap.has(templateElement)) {
this.conditionMap.set(templateElement, this.conditions) this.conditionMap.set(templateElement, this.conditions)
}
if(!this.initialMap.has(templateElement)) {
this.initialMap.set(templateElement, this.initial); this.initialMap.set(templateElement, this.initial);
} }
} }

View File

@ -33,7 +33,10 @@ export class CharacterSerializer {
return value.componentName return value.componentName
} }
if(key === 'conditionMap' || key === 'actionMap') { if(key === 'conditionMap' || key === 'actionMap' || key === 'initialMap') {
if(key === 'initialMap') {
console.log(value)
}
if(value.get(character) == undefined) { if(value.get(character) == undefined) {
return [] return []
} }

View File

@ -8,7 +8,7 @@ import {ProductTemplateSystem} from "../game-model/templates/productGamesystem/P
export class GamesystemSerializer { export class GamesystemSerializer {
private static IGNORED_SIMPLE_ATTRIBUTES = ["parentGamesystem", 'incomingTransitions', "outgoingTransitions", "unsaved", "type", "conditionMap", "actionMap"] private static IGNORED_SIMPLE_ATTRIBUTES = ["parentGamesystem", 'incomingTransitions', "outgoingTransitions", "unsaved", "type", "conditionMap", "actionMap", "initialMap"]
public static serializeGamesystems(gamesystems: Gamesystem<any, any>[]): StoreComponent[] { public static serializeGamesystems(gamesystems: Gamesystem<any, any>[]): StoreComponent[] {
let storedGamesystems: StoreComponent[] = [] let storedGamesystems: StoreComponent[] = []

View File

@ -2,5 +2,69 @@
"componentName": "Astrid Hofferson", "componentName": "Astrid Hofferson",
"componentDescription": "", "componentDescription": "",
"characterSpecificTemplateSystems": [], "characterSpecificTemplateSystems": [],
"characterRelationGamesystems": [] "characterRelationGamesystems": [
{
"componentName": "Characterbeziehungssystem",
"states": [
{
"stateLabel": "Feind",
"conditionMap": [],
"initialMap": true
},
{
"stateLabel": "Freund",
"conditionMap": [],
"initialMap": false
},
{
"stateLabel": "Fester Freund",
"conditionMap": [],
"initialMap": false
},
{
"stateLabel": "Eltern",
"conditionMap": [],
"initialMap": false
},
{
"stateLabel": "Geschwister",
"conditionMap": [],
"initialMap": false
},
{
"stateLabel": "Großeltern",
"conditionMap": [],
"initialMap": false
}
],
"transitions": [
{
"startingState": "Feind",
"endingState": "Freund",
"conditionMap": [],
"actionMap": []
},
{
"startingState": "Freund",
"endingState": "Feind",
"conditionMap": [],
"actionMap": []
},
{
"startingState": "Freund",
"endingState": "Fester Freund",
"conditionMap": [],
"actionMap": []
},
{
"startingState": "Fester Freund",
"endingState": "Feind",
"conditionMap": [],
"actionMap": []
}
],
"generateIsolatedStates": true,
"symmetric": true
}
]
} }

View File

@ -8,27 +8,33 @@
"states": [ "states": [
{ {
"stateLabel": "Feind", "stateLabel": "Feind",
"conditionMap": [] "conditionMap": [],
"initialMap": false
}, },
{ {
"stateLabel": "Freund", "stateLabel": "Freund",
"conditionMap": [] "conditionMap": [],
"initialMap": false
}, },
{ {
"stateLabel": "Fester Freund", "stateLabel": "Fester Freund",
"conditionMap": [] "conditionMap": [],
"initialMap": true
}, },
{ {
"stateLabel": "Eltern", "stateLabel": "Eltern",
"conditionMap": [] "conditionMap": [],
"initialMap": false
}, },
{ {
"stateLabel": "Geschwister", "stateLabel": "Geschwister",
"conditionMap": [] "conditionMap": [],
"initialMap": false
}, },
{ {
"stateLabel": "Großeltern", "stateLabel": "Großeltern",
"conditionMap": [] "conditionMap": [],
"initialMap": false
} }
], ],
"transitions": [ "transitions": [

View File

@ -9,7 +9,7 @@
"stateDescription": "" "stateDescription": ""
}, },
{ {
"initial": true, "initial": false,
"conditions": [], "conditions": [],
"stateLabel": "Freund", "stateLabel": "Freund",
"stateDescription": "" "stateDescription": ""