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) {
if(!this.conditionMap.has(templateElement)) {
this.conditionMap.set(templateElement, this.conditions)
}
if(!this.initialMap.has(templateElement)) {
this.initialMap.set(templateElement, this.initial);
}
}

View File

@ -33,7 +33,10 @@ export class CharacterSerializer {
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) {
return []
}

View File

@ -8,7 +8,7 @@ import {ProductTemplateSystem} from "../game-model/templates/productGamesystem/P
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[] {
let storedGamesystems: StoreComponent[] = []

View File

@ -2,5 +2,69 @@
"componentName": "Astrid Hofferson",
"componentDescription": "",
"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": [
{
"stateLabel": "Feind",
"conditionMap": []
"conditionMap": [],
"initialMap": false
},
{
"stateLabel": "Freund",
"conditionMap": []
"conditionMap": [],
"initialMap": false
},
{
"stateLabel": "Fester Freund",
"conditionMap": []
"conditionMap": [],
"initialMap": true
},
{
"stateLabel": "Eltern",
"conditionMap": []
"conditionMap": [],
"initialMap": false
},
{
"stateLabel": "Geschwister",
"conditionMap": []
"conditionMap": [],
"initialMap": false
},
{
"stateLabel": "Großeltern",
"conditionMap": []
"conditionMap": [],
"initialMap": false
}
],
"transitions": [

View File

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