+ {{displayedColumns[i]}} |
{{getLeafState(state, i).stateLabel}}
diff --git a/src/app/editor/gamesystem-editor/state-editor/product-state-editor/product-state-editor.component.ts b/src/app/editor/gamesystem-editor/state-editor/product-state-editor/product-state-editor.component.ts
index 066e478..1c7a7e8 100644
--- a/src/app/editor/gamesystem-editor/state-editor/product-state-editor/product-state-editor.component.ts
+++ b/src/app/editor/gamesystem-editor/state-editor/product-state-editor/product-state-editor.component.ts
@@ -29,6 +29,8 @@ export class ProductStateEditorComponent implements OnInit{
@Input() templateElement: TemplateElement | undefined
@Output('onOpenGamesystemEditor') openGamesystemEditorEmitter = new EventEmitter();
displayedColumns: string[] = [];
+ internalColumnNames: string[] = []
+
expandedColumns: string[] = []
datasource = new MatTableDataSource();
@@ -38,7 +40,12 @@ export class ProductStateEditorComponent implements OnInit{
this.gamesystem!.generateFromChildsystems();
this.generateColumnNamesRecursively(this.gamesystem!, "");
this.displayedColumns.push('Initial');
- this.expandedColumns = [...this.displayedColumns, 'expand'];
+
+ this.internalColumnNames = this.displayedColumns.concat();
+
+ this.renameDuplicateColumnNames(this.internalColumnNames)
+
+ this.expandedColumns = [...this.internalColumnNames, 'expand'];
if(this.templateElement == undefined) {
this.datasource.data = this.gamesystem!.states;
@@ -52,6 +59,20 @@ export class ProductStateEditorComponent implements OnInit{
}
}
+ private renameDuplicateColumnNames(columnNames: string[]) {
+ for(let i=0; i {
if(innerGamesystem instanceof SimpleGamesystem) {
diff --git a/src/app/editor/gamesystem-editor/state-editor/simple-state-editor/simple-state-editor.component.html b/src/app/editor/gamesystem-editor/state-editor/simple-state-editor/simple-state-editor.component.html
index c8f2e06..95b9422 100644
--- a/src/app/editor/gamesystem-editor/state-editor/simple-state-editor/simple-state-editor.component.html
+++ b/src/app/editor/gamesystem-editor/state-editor/simple-state-editor/simple-state-editor.component.html
@@ -39,12 +39,7 @@
Initial |
-
- done
- close
-
-
-
+
|
diff --git a/src/app/editor/gamesystem-editor/state-editor/simple-state-editor/simple-state-editor.component.ts b/src/app/editor/gamesystem-editor/state-editor/simple-state-editor/simple-state-editor.component.ts
index f09ff92..b6e03e9 100644
--- a/src/app/editor/gamesystem-editor/state-editor/simple-state-editor/simple-state-editor.component.ts
+++ b/src/app/editor/gamesystem-editor/state-editor/simple-state-editor/simple-state-editor.component.ts
@@ -35,15 +35,17 @@ export class SimpleStateEditorComponent implements OnInit{
editedStateLabelError: boolean = false;
+ testState: SimpleState | undefined = undefined
+
constructor(private snackbar: MatSnackBar) {
}
ngOnInit() {
this.dataSource.data = this.states;
+ this.testState = this.states[0]
this.dataSource.filterPredicate = (data: SimpleState, filter: string) => {
return data.stateLabel.toLowerCase().includes(filter);
}
- console.log(this.templateElement)
}
editState(state: SimpleState) {
@@ -127,4 +129,6 @@ export class SimpleStateEditorComponent implements OnInit{
return [];
}
}
+
+
}
diff --git a/src/app/editor/gamesystem-editor/state-editor/simple-state-editor/state-initial-cell/state-initial-cell.component.html b/src/app/editor/gamesystem-editor/state-editor/simple-state-editor/state-initial-cell/state-initial-cell.component.html
new file mode 100644
index 0000000..fc7f81b
--- /dev/null
+++ b/src/app/editor/gamesystem-editor/state-editor/simple-state-editor/state-initial-cell/state-initial-cell.component.html
@@ -0,0 +1,8 @@
+
diff --git a/src/app/editor/gamesystem-editor/state-editor/simple-state-editor/state-initial-cell/state-initial-cell.component.scss b/src/app/editor/gamesystem-editor/state-editor/simple-state-editor/state-initial-cell/state-initial-cell.component.scss
new file mode 100644
index 0000000..e69de29
diff --git a/src/app/editor/gamesystem-editor/state-editor/simple-state-editor/state-initial-cell/state-initial-cell.component.spec.ts b/src/app/editor/gamesystem-editor/state-editor/simple-state-editor/state-initial-cell/state-initial-cell.component.spec.ts
new file mode 100644
index 0000000..fab76c6
--- /dev/null
+++ b/src/app/editor/gamesystem-editor/state-editor/simple-state-editor/state-initial-cell/state-initial-cell.component.spec.ts
@@ -0,0 +1,23 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { StateInitialCellComponent } from './state-initial-cell.component';
+
+describe('StateInitialCellComponent', () => {
+ let component: StateInitialCellComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async () => {
+ await TestBed.configureTestingModule({
+ imports: [StateInitialCellComponent]
+ })
+ .compileComponents();
+
+ fixture = TestBed.createComponent(StateInitialCellComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/editor/gamesystem-editor/state-editor/simple-state-editor/state-initial-cell/state-initial-cell.component.ts b/src/app/editor/gamesystem-editor/state-editor/simple-state-editor/state-initial-cell/state-initial-cell.component.ts
new file mode 100644
index 0000000..0858bb4
--- /dev/null
+++ b/src/app/editor/gamesystem-editor/state-editor/simple-state-editor/state-initial-cell/state-initial-cell.component.ts
@@ -0,0 +1,33 @@
+import {Component, Input} from '@angular/core';
+import {SimpleState} from "../../../../../project/game-model/gamesystems/states/SimpleState";
+import {NgIf} from "@angular/common";
+import {TemplateElement} from "../../../../../project/game-model/templates/TemplateElement";
+import {SimpleTemplateState} from "../../../../../project/game-model/templates/simpleGamesystem/SimpleTemplateState";
+
+@Component({
+ selector: 'app-state-initial-cell',
+ templateUrl: './state-initial-cell.component.html',
+ styleUrl: './state-initial-cell.component.scss'
+})
+export class StateInitialCellComponent {
+
+ @Input() state: SimpleState | undefined
+ @Input() editedState: SimpleState | undefined | null
+ @Input() templateElement: TemplateElement | undefined
+
+ get initialValue(): boolean {
+ if(this.templateElement != undefined && this.state instanceof SimpleTemplateState && this.state.initialMap.has(this.templateElement!)) {
+ return this.state!.initialMap.get(this.templateElement!)!
+ } else {
+ return this.state!.initial;
+ }
+ }
+
+ set initialValue(value: boolean) {
+ if(this.templateElement != undefined && this.state instanceof SimpleTemplateState && this.state.initialMap.has(this.templateElement!)) {
+ this.state.initialMap.set(this.templateElement!, value)
+ } else {
+ this.state!.initial = value;
+ }
+ }
+}
diff --git a/src/app/editor/gamesystem-editor/transition-editor/product-transition-editor/product-transition-editor.component.ts b/src/app/editor/gamesystem-editor/transition-editor/product-transition-editor/product-transition-editor.component.ts
index 6c12eec..8bf42e1 100644
--- a/src/app/editor/gamesystem-editor/transition-editor/product-transition-editor/product-transition-editor.component.ts
+++ b/src/app/editor/gamesystem-editor/transition-editor/product-transition-editor/product-transition-editor.component.ts
@@ -50,6 +50,8 @@ export class ProductTransitionEditorComponent implements OnInit{
const leafGamesystems: SimpleGamesystem[] = LeafGamesystemCalculator.calcLeafGeamesystems(this.gamesystem);
this.displayedColumns = leafGamesystems.map(leafGamesystem => new DisplayedColumnName(leafGamesystem.componentName, leafGamesystem.componentName + "-start"));
this.displayedColumns = this.displayedColumns.concat( leafGamesystems.map(leafGamesystem => new DisplayedColumnName(leafGamesystem.componentName, leafGamesystem.componentName + "-end")));
+ this.renameDuplicateColumnNames(this.displayedColumns)
+
this.numberLeafSystems = leafGamesystems.length;
this.columns = this.displayedColumns.map(column => column.internalName)
@@ -72,6 +74,20 @@ export class ProductTransitionEditorComponent implements OnInit{
}
}
+ private renameDuplicateColumnNames(columnNames: DisplayedColumnName[]) {
+ for(let i=0; i character.componentName === characterName);
if(searchedCharacter == undefined) {
const character = new Character(characterName, "");
+ this.createCharacterRelation(character)
this.characters.push(character)
return character
}
return undefined
}
+ private createCharacterRelation(addedCharacter: Character) {
+ this.characters.forEach(character => {
+ const characterRelation = new CharacterRelation(character, addedCharacter);
+ character.addCharacterRelation(characterRelation);
+ addedCharacter.addCharacterRelation(characterRelation);
+ })
+ }
+
removeScriptAccount(scriptAccount: ScriptAccount) {
if(scriptAccount != undefined) {
this.scriptAccounts = this.scriptAccounts.filter(s => s != scriptAccount);
diff --git a/src/app/project/game-model/characters/Character.ts b/src/app/project/game-model/characters/Character.ts
index 4d9bf6c..51ec902 100644
--- a/src/app/project/game-model/characters/Character.ts
+++ b/src/app/project/game-model/characters/Character.ts
@@ -6,11 +6,16 @@ import {Gamesystem} from "../gamesystems/Gamesystem";
import {SimpleTemplateGamesystem} from "../templates/simpleGamesystem/SimpleTemplateGamesystem";
import {ProductTemplateSystem} from "../templates/productGamesystem/ProductTemplateSystem";
import {ProductGamesystem} from "../gamesystems/ProductGamesystem";
+import {CharacterRelation} from "./CharacterRelation";
export class Character extends ModelComponent implements TemplateElement {
characterSpecificTemplateSystems: Gamesystem[] = []
+ characterRelations: CharacterRelation[] = []
+
+ characterRelationGamesystems: Gamesystem[] = []
+
constructor(componentName: string, componentDescription: string) {
super(componentName, componentDescription, ModelComponentType.CHARACTER);
}
@@ -36,8 +41,48 @@ export class Character extends ModelComponent implements TemplateElement {
}
}
+ addAsymetricCharacterRelationGamesystem(gamesystem: Gamesystem, recursiveCall: boolean = false) {
+ if(!this.isTemplateSystemCharacterRelationSpecific(gamesystem.componentName)) {
+ if(gamesystem instanceof SimpleTemplateGamesystem) {
+ this.characterRelationGamesystems.push(gamesystem);
+ gamesystem.addTemplateElement(this);
+ this.characterRelations.forEach(characterRelation => {
+ characterRelation.addCharacterRelationSystem(gamesystem)
+ })
+ } else if(gamesystem instanceof ProductTemplateSystem) {
+ this.characterRelationGamesystems.push(gamesystem);
+ gamesystem.addTemplateElement(this);
+ this.characterRelations.forEach(characterRelation => {
+ characterRelation.addCharacterRelationSystem(gamesystem)
+ })
+
+ if(!recursiveCall) {
+ gamesystem.innerGamesystems.forEach(innerGamesystem => this.addAsymetricCharacterRelationGamesystem(innerGamesystem, true))
+ }
+ }
+
+ if(gamesystem.parentGamesystem != undefined) {
+ this.addAsymetricCharacterRelationGamesystem(gamesystem.parentGamesystem, true)
+ }
+
+ } else {
+ console.log("Was already added")
+ console.log(this)
+ }
+ }
+
+ addCharacterRelation(characterRelation: CharacterRelation) {
+ this.characterRelations.push(characterRelation)
+ }
+
private isTemplateSystemCharacterSpecific(gamesystemName: string) {
return this.characterSpecificTemplateSystems.find(gamesystem => gamesystem.componentName === gamesystemName) != undefined
}
+ private isTemplateSystemCharacterRelationSpecific(gamesystemName: string) {
+ return this.characterRelationGamesystems.find(gamesystem =>
+ gamesystem.componentName === gamesystemName) != undefined;
+
+ }
+
}
diff --git a/src/app/project/game-model/characters/CharacterRelation.ts b/src/app/project/game-model/characters/CharacterRelation.ts
new file mode 100644
index 0000000..fe1307a
--- /dev/null
+++ b/src/app/project/game-model/characters/CharacterRelation.ts
@@ -0,0 +1,38 @@
+import {TemplateElement} from "../templates/TemplateElement";
+import {Character} from "./Character";
+import {ProductTemplateSystem} from "../templates/productGamesystem/ProductTemplateSystem";
+import {Gamesystem} from "../gamesystems/Gamesystem";
+import {SimpleTemplateGamesystem} from "../templates/simpleGamesystem/SimpleTemplateGamesystem";
+import {TemplateType} from "../templates/TemplateType";
+import {ProductTemplateCreator} from "../templates/productGamesystem/ProductTemplateCreator";
+
+export class CharacterRelation implements TemplateElement{
+
+ firstCharacter: Character
+ secondCharacter: Character
+
+ characterRelationGamesystems: ProductTemplateSystem[] = []
+
+ constructor(firstCharacter: Character, secondCharacter: Character) {
+ this.firstCharacter = firstCharacter;
+ this.secondCharacter = secondCharacter;
+ }
+
+ addCharacterRelationSystem(gamesystem: Gamesystem) {
+ if((gamesystem instanceof SimpleTemplateGamesystem || gamesystem instanceof ProductTemplateSystem) && !this.isGamesystemCharacterRelationSpecific(gamesystem.componentName)) {
+ const templateGamesystem = new ProductTemplateSystem(gamesystem.componentName, gamesystem.componentDescription, TemplateType.CHARACTER_RELATION);
+ templateGamesystem.symmetric = gamesystem.symmetric
+ templateGamesystem.generateIsolatedStates = gamesystem.generateIsolatedStates
+ templateGamesystem.addChildGamesystem(gamesystem);
+ templateGamesystem.addChildGamesystem(gamesystem);
+ this.characterRelationGamesystems.push(templateGamesystem);
+ templateGamesystem.addTemplateElement(this);
+ } else {
+ console.log("Test")
+ }
+ }
+
+ private isGamesystemCharacterRelationSpecific(gamesystemName: string) {
+ return this.characterRelationGamesystems.find(gamesystem => gamesystem.componentName === gamesystemName) != undefined
+ }
+}
diff --git a/src/app/project/game-model/gamesystems/Gamesystem.ts b/src/app/project/game-model/gamesystems/Gamesystem.ts
index 2e94174..981590a 100644
--- a/src/app/project/game-model/gamesystems/Gamesystem.ts
+++ b/src/app/project/game-model/gamesystems/Gamesystem.ts
@@ -8,6 +8,8 @@ export abstract class Gamesystem extends ModelComponent{
states: S[] = [];
transitions: T[] = [];
parentGamesystem: ProductGamesystem | undefined
+ generateIsolatedStates: boolean = false
+
constructor(gamesystemName: string, gamesystemDescription: string) {
super(gamesystemName, gamesystemDescription, ModelComponentType.GAMESYTEM);
}
diff --git a/src/app/project/game-model/gamesystems/ProductGamesystem.ts b/src/app/project/game-model/gamesystems/ProductGamesystem.ts
index a7d380f..2b77cdc 100644
--- a/src/app/project/game-model/gamesystems/ProductGamesystem.ts
+++ b/src/app/project/game-model/gamesystems/ProductGamesystem.ts
@@ -11,6 +11,7 @@ import {ScriptAccountAction} from "./actions/ScriptAccountAction";
import {ProductSystemGenerator} from "./productSystemGenerator/ProductSystemGenerator";
import {TemplateType} from "../templates/TemplateType";
import {ProductTemplateSystem} from "../templates/productGamesystem/ProductTemplateSystem";
+import {IsolatedProductStateGenerator} from "./productSystemGenerator/IsolatedProductStateGenerator";
export class ProductGamesystem extends Gamesystem {
@@ -74,6 +75,11 @@ export class ProductGamesystem extends Gamesystem, Transition>) {
diff --git a/src/app/project/game-model/gamesystems/productSystemGenerator/IsolatedProductStateGenerator.ts b/src/app/project/game-model/gamesystems/productSystemGenerator/IsolatedProductStateGenerator.ts
new file mode 100644
index 0000000..8f3933b
--- /dev/null
+++ b/src/app/project/game-model/gamesystems/productSystemGenerator/IsolatedProductStateGenerator.ts
@@ -0,0 +1,53 @@
+import {ProductSystemGenerator} from "./ProductSystemGenerator";
+import {ProductGenerationData} from "./ProductGenerationData";
+import {ProductGeneratorResult} from "./ProductGeneratorResult";
+import {ProductState} from "../states/ProductState";
+
+export class IsolatedProductStateGenerator extends ProductSystemGenerator {
+
+ generateIsolatedProductStates() {
+ if(this.productGamesystem.innerGamesystems.length < 2) return;
+
+ const leftInitialData = this.prepareChildsystemForGeneration(this.productGamesystem.innerGamesystems[0])
+ const rightInitialData = this.prepareChildsystemForGeneration(this.productGamesystem.innerGamesystems[1])
+
+ const initialGenerationResult = this.generateBinaryIsolatedProductStates(leftInitialData, rightInitialData);
+
+ if(this.productGamesystem.innerGamesystems.length > 2) {
+ for(let i=2; i {
+ if(leftState.outgoingTransitions.length == 0 && leftState.incomingTransitions.length == 0) {
+ rightSystemData.states.forEach(rightState => {
+ if(rightState.outgoingTransitions.length == 0 && rightState.incomingTransitions.length == 0) {
+ const leftConditions = this.getStateConditions(leftState, true);
+ const rightConditions = this.getStateConditions(rightState, true);
+
+ if(!this.contradictCombinedConditions(leftConditions, rightConditions)) {
+ this.generateBinaryProductState(leftState, rightState, generatedProductStates);
+ }
+ }
+ })
+ }
+ })
+ return new ProductGeneratorResult(generatedProductStates, []);
+ }
+
+}
diff --git a/src/app/project/game-model/gamesystems/productSystemGenerator/IsolatedSymmetricTemplateStateGenerator.ts b/src/app/project/game-model/gamesystems/productSystemGenerator/IsolatedSymmetricTemplateStateGenerator.ts
new file mode 100644
index 0000000..fccf00c
--- /dev/null
+++ b/src/app/project/game-model/gamesystems/productSystemGenerator/IsolatedSymmetricTemplateStateGenerator.ts
@@ -0,0 +1,42 @@
+import {IsolatedTemplateStateGenerator} from "./IsolatedTemplateStateGenerator";
+import {ProductGenerationData} from "./ProductGenerationData";
+import {ProductGeneratorResult} from "./ProductGeneratorResult";
+import {ProductState} from "../states/ProductState";
+import {SimpleState} from "../states/SimpleState";
+import {State} from "../states/State";
+import {ScriptAccountCondition} from "../conditions/ScriptAccountCondition";
+
+export class IsolatedSymmetricTemplateStateGenerator extends IsolatedTemplateStateGenerator{
+
+
+ protected generateBinaryIsolatedProductStates(leftSystemData: ProductGenerationData, rightSystemData: ProductGenerationData): ProductGeneratorResult {
+
+ const generatedProductStates: ProductState[] = []
+ leftSystemData.states.forEach(leftState => {
+ if(leftState.outgoingTransitions.length == 0 && leftState.incomingTransitions.length == 0) {
+ rightSystemData.states.forEach(rightState => {
+ if(leftState.equals(rightState)) {
+ if(rightState.outgoingTransitions.length == 0 && rightState.incomingTransitions.length == 0) {
+ const leftConditions = this.getStateConditions(leftState, true);
+ const rightConditions = this.getStateConditions(rightState, true);
+
+ if(!this.contradictCombinedConditions(leftConditions, rightConditions)) {
+ this.generateBinaryProductState(leftState, rightState, generatedProductStates);
+ }
+ }
+ }
+
+ if(leftState.equals(rightState) && rightState.outgoingTransitions.length == 0 && rightState.incomingTransitions.length == 0) {
+ const leftConditions = this.getStateConditions(leftState, true);
+ const rightConditions = this.getStateConditions(rightState, true);
+
+ if(!this.contradictCombinedConditions(leftConditions, rightConditions)) {
+ const generatedState = this.generateBinaryProductState(leftState, rightState, generatedProductStates);
+ }
+ }
+ })
+ }
+ })
+ return new ProductGeneratorResult(generatedProductStates, []);
+ }
+}
diff --git a/src/app/project/game-model/gamesystems/productSystemGenerator/IsolatedTemplateStateGenerator.ts b/src/app/project/game-model/gamesystems/productSystemGenerator/IsolatedTemplateStateGenerator.ts
new file mode 100644
index 0000000..ad2fe31
--- /dev/null
+++ b/src/app/project/game-model/gamesystems/productSystemGenerator/IsolatedTemplateStateGenerator.ts
@@ -0,0 +1,66 @@
+import {IsolatedProductStateGenerator} from "./IsolatedProductStateGenerator";
+import {Transition} from "../transitions/Transition";
+import {SimpleTemplateTransition} from "../../templates/simpleGamesystem/SimpleTemplateTransition";
+import {State} from "../states/State";
+import {ScriptAccountCondition} from "../conditions/ScriptAccountCondition";
+import {SimpleTemplateState} from "../../templates/simpleGamesystem/SimpleTemplateState";
+import {Character} from "../../characters/Character";
+import {CharacterRelation} from "../../characters/CharacterRelation";
+import {TemplateElement} from "../../templates/TemplateElement";
+import {ProductTemplateSystem} from "../../templates/productGamesystem/ProductTemplateSystem";
+import {ProductGeneratorResult} from "./ProductGeneratorResult";
+import {state, transition} from "@angular/animations";
+
+export class IsolatedTemplateStateGenerator extends IsolatedProductStateGenerator {
+ templateElement: TemplateElement
+
+ constructor(productGamesystem: ProductTemplateSystem, templateElement: TemplateElement) {
+ super(productGamesystem);
+ this.templateElement = templateElement;
+ }
+
+
+ protected assignGeneratedStatesAndTransitions(generationResult: ProductGeneratorResult) {
+ const templateSystem = this.productGamesystem as ProductTemplateSystem;
+
+ const nonIsolatedStates = templateSystem.stateMap.get(this.templateElement)!
+ const states = nonIsolatedStates.concat(generationResult.states);
+ templateSystem.stateMap.set(this.templateElement, states)
+ }
+
+ protected getTransitionConditions(transition: Transition, leftSystem: boolean) {
+ const templateElement = this.determineTemplateElement(leftSystem)!;
+ if(transition instanceof SimpleTemplateTransition && transition.conditionMap.has(templateElement)) {
+ return transition.conditionMap.get(templateElement)!
+ }
+ return transition.scriptAccountConditions;
+ }
+
+ protected getTransitionActions(transition: Transition, leftSystem: boolean) {
+ const templateElement = this.determineTemplateElement(leftSystem)!;
+
+ if(transition instanceof SimpleTemplateTransition && transition.actionMap.has(templateElement)) {
+ return transition.actionMap.get(templateElement)!
+ } else {
+ return transition.scriptAccountActions;
+ }
+ }
+
+
+ protected getStateConditions(state: State, leftSystem: boolean): ScriptAccountCondition[] {
+ const templateElement = this.determineTemplateElement(leftSystem)!
+ if(state instanceof SimpleTemplateState && state.conditionMap.has(templateElement)) {
+ return state.conditionMap.get(templateElement)!
+ } else {
+ return state.conditions
+ }
+ }
+
+ private determineTemplateElement(leftSystem: boolean) {
+ if(this.templateElement instanceof Character) {
+ return this.templateElement;
+ } else if(this.templateElement instanceof CharacterRelation) {
+ return leftSystem ? this.templateElement.firstCharacter : this.templateElement.secondCharacter;
+ }
+ }
+}
diff --git a/src/app/project/game-model/gamesystems/productSystemGenerator/ProductSystemGenerator.ts b/src/app/project/game-model/gamesystems/productSystemGenerator/ProductSystemGenerator.ts
index 816533b..e1902a0 100644
--- a/src/app/project/game-model/gamesystems/productSystemGenerator/ProductSystemGenerator.ts
+++ b/src/app/project/game-model/gamesystems/productSystemGenerator/ProductSystemGenerator.ts
@@ -9,6 +9,7 @@ import {Gamesystem} from "../Gamesystem";
import {ProductGenerationData} from "./ProductGenerationData";
import {ProductTransition} from "../transitions/ProductTransition";
import {SimpleTemplateTransition} from "../../templates/simpleGamesystem/SimpleTemplateTransition";
+import {ProductTemplateSystem} from "../../templates/productGamesystem/ProductTemplateSystem";
export class ProductSystemGenerator {
productGamesystem: ProductGamesystem
@@ -59,12 +60,12 @@ export class ProductSystemGenerator {
if(startingState != undefined) {
const endingState_right = this.generateBinaryProductState(leftState, rightState.outgoingTransitions[j].endingState, generatedProductStates);
if(endingState_right != undefined) {
- this.generateBinaryProductTransition(startingState, endingState_right, rightState.outgoingTransitions[j], generatedProductTransitions);
+ this.generateBinaryProductTransition(startingState, endingState_right, rightState.outgoingTransitions[j], generatedProductTransitions, false);
}
const endingState_left = this.generateBinaryProductState(leftState.outgoingTransitions[i].endingState, rightState, generatedProductStates);
if(endingState_left != undefined) {
- this.generateBinaryProductTransition(startingState, endingState_left, leftState.outgoingTransitions[i], generatedProductTransitions)
+ this.generateBinaryProductTransition(startingState, endingState_left, leftState.outgoingTransitions[i], generatedProductTransitions, true)
}
const endingState_left_right = this.generateBinaryProductState(leftState.outgoingTransitions[i].endingState, rightState.outgoingTransitions[j].endingState, generatedProductStates);
@@ -79,7 +80,7 @@ export class ProductSystemGenerator {
const endingState = this.generateBinaryProductState(leftState.outgoingTransitions[i].endingState, rightState, generatedProductStates);
if(startingState != undefined && endingState != undefined) {
- this.generateBinaryProductTransition(startingState, endingState, leftState.outgoingTransitions[i], generatedProductTransitions)
+ this.generateBinaryProductTransition(startingState, endingState, leftState.outgoingTransitions[i], generatedProductTransitions, true)
}
}
@@ -91,7 +92,7 @@ export class ProductSystemGenerator {
const endingState = this.generateBinaryProductState(leftState, rightState.outgoingTransitions[j].endingState, generatedProductStates);
if(startingState != undefined && endingState != undefined) {
- this.generateBinaryProductTransition(startingState, endingState, rightState.outgoingTransitions[j], generatedProductTransitions);
+ this.generateBinaryProductTransition(startingState, endingState, rightState.outgoingTransitions[j], generatedProductTransitions, false);
}
@@ -106,12 +107,13 @@ export class ProductSystemGenerator {
protected assignGeneratedStatesAndTransitions(generationResult: ProductGeneratorResult): void {
this.productGamesystem.states = generationResult.states;
this.productGamesystem.transitions = generationResult.transitions;
+
}
- protected generateBinaryProductTransition(startingState: ProductState, endingState: ProductState, usedTransition: Transition, generatedTransitions: ProductTransition[]) {
+ protected generateBinaryProductTransition(startingState: ProductState, endingState: ProductState, usedTransition: Transition, generatedTransitions: ProductTransition[], leftSystem: boolean) {
const transition = new ProductTransition(startingState, endingState);
- transition.scriptAccountActions = [... this.getTransitionActions(usedTransition)];
- transition.scriptAccountConditions = [... this.getTransitionConditions(usedTransition)];
+ transition.scriptAccountActions = [... this.getTransitionActions(usedTransition, leftSystem)];
+ transition.scriptAccountConditions = [... this.getTransitionConditions(usedTransition, leftSystem)];
if(generatedTransitions.find(generatedTransition => generatedTransition.startingState.equals(startingState) && generatedTransition.endingState.equals(endingState)) == undefined) {
generatedTransitions.push(transition)
@@ -119,13 +121,13 @@ export class ProductSystemGenerator {
}
protected generateBinaryProductTransitionMulti(startingState: ProductState, endingState: ProductState, leftTransition: Transition, rightTransition: Transition, generatedTransitions: ProductTransition[]) {
- const leftConditions = this.getTransitionConditions(leftTransition)
- const rightConditions = this.getTransitionConditions(rightTransition)
+ const leftConditions = this.getTransitionConditions(leftTransition, true)
+ const rightConditions = this.getTransitionConditions(rightTransition, false)
if(!this.contradictCombinedConditions(leftConditions, rightConditions)) {
const transition = new ProductTransition(startingState, endingState)
- transition.scriptAccountActions = this.generateCombinedActions(this.getTransitionActions(leftTransition), this.getTransitionActions(rightTransition));
- transition.scriptAccountConditions = this.generateCombinedConditions(this.getTransitionConditions(leftTransition), this.getTransitionConditions(rightTransition));
+ transition.scriptAccountActions = this.generateCombinedActions(this.getTransitionActions(leftTransition, true), this.getTransitionActions(rightTransition, false));
+ transition.scriptAccountConditions = this.generateCombinedConditions(this.getTransitionConditions(leftTransition, true), this.getTransitionConditions(rightTransition, false));
if(generatedTransitions.find(generatedTransition => generatedTransition.startingState.equals(startingState) && generatedTransition.endingState.equals(endingState)) == undefined) {
generatedTransitions.push(transition)
@@ -134,8 +136,8 @@ export class ProductSystemGenerator {
}
protected generateBinaryProductState(leftState: State, rightState: State, generatedStates: ProductState[]): ProductState | undefined {
- const leftConditions = this.getStateConditions(leftState)
- const rightConditions = this.getStateConditions(rightState)
+ const leftConditions = this.getStateConditions(leftState, true)
+ const rightConditions = this.getStateConditions(rightState, false)
const combinedStateConditions: ScriptAccountCondition[] = leftConditions.concat(rightConditions)
for(let i=0; i) {
+ protected getTransitionConditions(transition: Transition, leftSystem: boolean) {
return transition.scriptAccountConditions;
}
- protected getTransitionActions(transition: Transition) {
+ protected getTransitionActions(transition: Transition, leftSystem: boolean) {
return transition.scriptAccountActions;
}
- protected getStateConditions(state: State) {
+ protected getStateConditions(state: State, leftSystem: boolean) {
return state.conditions;
}
diff --git a/src/app/project/game-model/gamesystems/productSystemGenerator/SymmetricProductTemplateGenerator.ts b/src/app/project/game-model/gamesystems/productSystemGenerator/SymmetricProductTemplateGenerator.ts
new file mode 100644
index 0000000..848aa04
--- /dev/null
+++ b/src/app/project/game-model/gamesystems/productSystemGenerator/SymmetricProductTemplateGenerator.ts
@@ -0,0 +1,34 @@
+import {TemplateProductSystemGenerator} from "./TemplateProductSystemGenerator";
+import {ProductGenerationData} from "./ProductGenerationData";
+import {ProductGeneratorResult} from "./ProductGeneratorResult";
+import {ProductState} from "../states/ProductState";
+import {ProductTransition} from "../transitions/ProductTransition";
+import {ProductTemplateSystem} from "../../templates/productGamesystem/ProductTemplateSystem";
+
+export class SymmetricProductTemplateGenerator extends TemplateProductSystemGenerator {
+ protected generateFromBinaryChildsystems(leftSystemData: ProductGenerationData, rightSystemData: ProductGenerationData): ProductGeneratorResult {
+ const generatedProductStates: ProductState[] = []
+ const generatedProductTransitions: ProductTransition[] = []
+
+ leftSystemData.states.forEach(leftState => {
+ rightSystemData.states.forEach(rightState => {
+ if(leftState.equals(rightState)) {
+ for(let i=0; i) {
- if(transition instanceof SimpleTemplateTransition) {
- return transition.conditionMap.get(this.templateElement)!
- } else {
- return transition.scriptAccountConditions;
+ protected getTransitionConditions(transition: Transition, leftSystem: boolean) {
+ const templateElement = this.determineTemplateElement(leftSystem)!;
+ if(transition instanceof SimpleTemplateTransition && transition.conditionMap.has(templateElement)) {
+ return transition.conditionMap.get(templateElement)!
}
+ return transition.scriptAccountConditions;
}
- protected getTransitionActions(transition: Transition) {
- if(transition instanceof SimpleTemplateTransition) {
- return transition.actionMap.get(this.templateElement)!
+ protected getTransitionActions(transition: Transition, leftSystem: boolean) {
+ const templateElement = this.determineTemplateElement(leftSystem)!;
+
+ if(transition instanceof SimpleTemplateTransition && transition.actionMap.has(templateElement)) {
+ return transition.actionMap.get(templateElement)!
} else {
return transition.scriptAccountActions;
}
}
- protected getStateConditions(state: State): ScriptAccountCondition[] {
- if(state instanceof SimpleTemplateState) {
- return state.conditionMap.get(this.templateElement)!
+ protected getStateConditions(state: State, leftSystem: boolean): ScriptAccountCondition[] {
+ const templateElement = this.determineTemplateElement(leftSystem)!
+ if(state instanceof SimpleTemplateState && state.conditionMap.has(templateElement)) {
+ return state.conditionMap.get(templateElement)!
} else {
return state.conditions
}
}
+
+ private determineTemplateElement(leftSystem: boolean) {
+ if(this.templateElement instanceof Character) {
+ return this.templateElement;
+ } else if(this.templateElement instanceof CharacterRelation) {
+ return leftSystem ? this.templateElement.firstCharacter : this.templateElement.secondCharacter;
+ }
+ }
}
diff --git a/src/app/project/game-model/templates/TemplateType.ts b/src/app/project/game-model/templates/TemplateType.ts
index 6961052..f8318e7 100644
--- a/src/app/project/game-model/templates/TemplateType.ts
+++ b/src/app/project/game-model/templates/TemplateType.ts
@@ -1,3 +1,4 @@
export enum TemplateType {
- CHARACTER
+ CHARACTER,
+ CHARACTER_RELATION
}
diff --git a/src/app/project/game-model/templates/TemplateTypeUtilities.ts b/src/app/project/game-model/templates/TemplateTypeUtilities.ts
index 7efc792..837b610 100644
--- a/src/app/project/game-model/templates/TemplateTypeUtilities.ts
+++ b/src/app/project/game-model/templates/TemplateTypeUtilities.ts
@@ -4,6 +4,8 @@ export class TemplateTypeUtilities {
static fromString(string: string) {
if(string === 'character') {
return TemplateType.CHARACTER
+ } else if(string === 'character_relation') {
+ return TemplateType.CHARACTER_RELATION
}
}
}
diff --git a/src/app/project/game-model/templates/productGamesystem/ProductTemplateSystem.ts b/src/app/project/game-model/templates/productGamesystem/ProductTemplateSystem.ts
index e6957fd..70caac1 100644
--- a/src/app/project/game-model/templates/productGamesystem/ProductTemplateSystem.ts
+++ b/src/app/project/game-model/templates/productGamesystem/ProductTemplateSystem.ts
@@ -7,12 +7,20 @@ import {SimpleGamesystem} from "../../gamesystems/SimpleGamesystem";
import {GameModel} from "../../GameModel";
import {TemplateType} from "../TemplateType";
import {TemplateProductSystemGenerator} from "../../gamesystems/productSystemGenerator/TemplateProductSystemGenerator";
+import {
+ SymmetricProductTemplateGenerator
+} from "../../gamesystems/productSystemGenerator/SymmetricProductTemplateGenerator";
+import {IsolatedTemplateStateGenerator} from "../../gamesystems/productSystemGenerator/IsolatedTemplateStateGenerator";
+import {
+ IsolatedSymmetricTemplateStateGenerator
+} from "../../gamesystems/productSystemGenerator/IsolatedSymmetricTemplateStateGenerator";
export class ProductTemplateSystem extends ProductGamesystem implements TemplateGamesystem{
stateMap: Map = new Map();
transitionMap: Map = new Map()
templateType: TemplateType
+ symmetric: boolean = false
constructor(gamesystemName: string, gamesystemDescription: string, templateType: TemplateType) {
@@ -21,8 +29,25 @@ export class ProductTemplateSystem extends ProductGamesystem implements Template
}
addTemplateElement(templateElement: TemplateElement): void {
- const productTemplateGenerator = new TemplateProductSystemGenerator(this, templateElement);
- productTemplateGenerator.generateFromChildsystems()
+ if(this.symmetric) {
+ const symmetricGenerator = new SymmetricProductTemplateGenerator(this, templateElement);
+ symmetricGenerator.generateFromChildsystems()
+
+ if(this.generateIsolatedStates) {
+ const isolatedTemplateStateGenerator = new IsolatedSymmetricTemplateStateGenerator(this, templateElement);
+ isolatedTemplateStateGenerator.generateIsolatedProductStates();
+ }
+ } else {
+ const productTemplateGenerator = new TemplateProductSystemGenerator(this, templateElement);
+ productTemplateGenerator.generateFromChildsystems()
+
+ if(this.generateIsolatedStates) {
+ const isolatedTemplateStateGenerator = new IsolatedTemplateStateGenerator(this, templateElement);
+ isolatedTemplateStateGenerator.generateIsolatedProductStates();
+ }
+ }
+
+
}
}
diff --git a/src/app/project/game-model/templates/simpleGamesystem/SimpleTemplateGamesystem.ts b/src/app/project/game-model/templates/simpleGamesystem/SimpleTemplateGamesystem.ts
index 17856d2..bb8af87 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 = false
constructor(gamesystemName: string, gamesystemDescription: string, templateType: TemplateType) {
super(gamesystemName, gamesystemDescription);
diff --git a/src/app/project/game-model/templates/simpleGamesystem/SimpleTemplateState.ts b/src/app/project/game-model/templates/simpleGamesystem/SimpleTemplateState.ts
index 50bb918..1c130be 100644
--- a/src/app/project/game-model/templates/simpleGamesystem/SimpleTemplateState.ts
+++ b/src/app/project/game-model/templates/simpleGamesystem/SimpleTemplateState.ts
@@ -5,11 +5,16 @@ import {ScriptAccountCondition} from "../../gamesystems/conditions/ScriptAccount
export class SimpleTemplateState extends SimpleState {
conditionMap: Map = new Map();
+ initialMap: Map = new Map();
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);
+ }
}
removeTemplateElement(templateElement: TemplateElement) {
diff --git a/src/app/project/parser/characterParser/CharacterParser.ts b/src/app/project/parser/characterParser/CharacterParser.ts
index 0570861..6472cb1 100644
--- a/src/app/project/parser/characterParser/CharacterParser.ts
+++ b/src/app/project/parser/characterParser/CharacterParser.ts
@@ -6,16 +6,21 @@ import {ScriptAccountConditionParser} from "../gamesystemParser/ScriptAccountCon
import {ScriptAccount} from "../../game-model/scriptAccounts/ScriptAccount";
import {SimpleTemplateState} from "../../game-model/templates/simpleGamesystem/SimpleTemplateState";
import {SimpleTemplateTransition} from "../../game-model/templates/simpleGamesystem/SimpleTemplateTransition";
+import {CharacterRelation} from "../../game-model/characters/CharacterRelation";
+import {load} from "@angular-devkit/build-angular/src/utils/server-rendering/esm-in-memory-loader/loader-hooks";
+import {Gamesystem} from "../../game-model/gamesystems/Gamesystem";
export class CharacterParser {
characterSpecificGamesystems: SimpleTemplateGamesystem[]
+ characterRelationSpecificGamesystems: SimpleTemplateGamesystem[]
scriptAccountConditionParser: ScriptAccountConditionParser
scriptAccountActionParser: ScriptAccountActionParser
- constructor(characterSpecificGamesystems: SimpleTemplateGamesystem[], scriptAccounts: ScriptAccount[]) {
+ constructor(characterSpecificGamesystems: SimpleTemplateGamesystem[], characterRelationSpecificGamesystems: SimpleTemplateGamesystem[], scriptAccounts: ScriptAccount[]) {
this.characterSpecificGamesystems = characterSpecificGamesystems;
+ this.characterRelationSpecificGamesystems = characterRelationSpecificGamesystems;
this.scriptAccountActionParser = new ScriptAccountActionParser(scriptAccounts);
this.scriptAccountConditionParser = new ScriptAccountConditionParser(scriptAccounts)
}
@@ -23,29 +28,39 @@ export class CharacterParser {
public parseCharacters(characters: StoreComponent[]): Character[] {
const loadedCharacters: Character[] = []
- characters.forEach(character => loadedCharacters.push(this.parseSingleCharacter(JSON.parse(character.jsonString))))
+ characters.forEach(character => loadedCharacters.push(this.parseSingleCharacter(JSON.parse(character.jsonString), loadedCharacters)))
return loadedCharacters;
}
- private parseSingleCharacter(characterData: any): Character {
+ private parseSingleCharacter(characterData: any, loadedCharacters: Character[]): Character {
const character = new Character(characterData.componentName, characterData.componentDescription);
- const templateSpecificGamesystems = this.parseCharacterSpecificGamesystems(character, characterData.characterSpecificTemplateSystems);
+
+ loadedCharacters.forEach(loadedCharacter => {
+ const characterRelation = new CharacterRelation(loadedCharacter, character);
+ loadedCharacter.addCharacterRelation(characterRelation)
+ character.addCharacterRelation(characterRelation)
+ })
+
+ const templateSpecificGamesystems = this.parseCharacterSpecificGamesystems(character, characterData.characterSpecificTemplateSystems, this.characterSpecificGamesystems);
templateSpecificGamesystems.forEach(system => character.addCharacterSpecificSimpleTemplatesystem(system))
+
+ const characterRelationGamesystems = this.parseCharacterSpecificGamesystems(character, characterData.characterRelationGamesystems, this.characterRelationSpecificGamesystems)
+ characterRelationGamesystems.forEach(gamesystem => character.addAsymetricCharacterRelationGamesystem(gamesystem))
return character;
}
- private parseCharacterSpecificGamesystems(character: Character, characterSpecificGamesystems: any): SimpleTemplateGamesystem[] {
+ private parseCharacterSpecificGamesystems(character: Character, characterSpecificGamesystems: any, templateGamesystems: SimpleTemplateGamesystem[]): SimpleTemplateGamesystem[] {
const result: SimpleTemplateGamesystem[] = []
for(let i=0; i gamesystem.componentName === componentName)
+ private findCharacterSpecificGamesystem(gamesystems: SimpleTemplateGamesystem[], componentName: string): SimpleTemplateGamesystem | undefined{
+ return gamesystems.find(gamesystem => gamesystem.componentName === componentName)
}
private findReferencedState(gamesystem: SimpleTemplateGamesystem, stateLabel: string) {
diff --git a/src/app/project/parser/gamesystemParser/GamesystemParser.ts b/src/app/project/parser/gamesystemParser/GamesystemParser.ts
index 0e4ce93..5e7ad14 100644
--- a/src/app/project/parser/gamesystemParser/GamesystemParser.ts
+++ b/src/app/project/parser/gamesystemParser/GamesystemParser.ts
@@ -45,6 +45,7 @@ export class GamesystemParser {
let simpleGamesystem
if(gamesystemData.templateType != undefined) {
simpleGamesystem = new SimpleTemplateGamesystem(gamesystemData.componentName, gamesystemData.componentDescription, gamesystemData.templateType)
+ simpleGamesystem.symmetric = gamesystemData.symmetric
} else {
simpleGamesystem = new SimpleGamesystem(gamesystemData.componentName, gamesystemData.componentDescription)
}
@@ -56,6 +57,7 @@ export class GamesystemParser {
const transitionParser = new TransitionParser(simpleGamesystem.states, this.scriptAccounts)
simpleGamesystem.transitions = transitionParser.parseTransitions(gamesystemData.transitions, gamesystemData.templateType)
+ simpleGamesystem.generateIsolatedStates = gamesystemData.generateIsolatedStates;
return simpleGamesystem
}
@@ -66,8 +68,11 @@ export class GamesystemParser {
productGamesystem = new ProductGamesystem(gamesystemData.componentName, gamesystemData.componentDescription);
} else {
productGamesystem = new ProductTemplateSystem(gamesystemData.componentName, gamesystemData.componentDescription, gamesystemData.templateType)
+ productGamesystem.symmetric = gamesystemData.symmetric
}
+ productGamesystem.generateIsolatedStates = gamesystemData.generateIsolatedStates
+
const childsystemNames: string[] = []
for(let i=0; i[]): StoreComponent[] {
let storedGamesystems: StoreComponent[] = []
@@ -66,13 +66,16 @@ export class GamesystemSerializer {
'componentName': productGamesystem.componentName,
'componentDescription': productGamesystem.componentDescription,
'childsystems': innerGamesystemJsonArray,
- 'templateType': productGamesystem.templateType
+ 'templateType': productGamesystem.templateType,
+ 'symmetric': productGamesystem.symmetric,
+ 'generateIsolatedStates':productGamesystem.generateIsolatedStates
}
} else {
jsonString = {
'componentName': productGamesystem.componentName,
'componentDescription': productGamesystem.componentDescription,
'childsystems': innerGamesystemJsonArray,
+ 'generateIsolatedStates':productGamesystem.generateIsolatedStates
}
}
diff --git a/testModel/characters/Astrid Hofferson.json b/testModel/characters/Astrid Hofferson.json
index 014ec69..64ad8a6 100644
--- a/testModel/characters/Astrid Hofferson.json
+++ b/testModel/characters/Astrid Hofferson.json
@@ -1,50 +1,70 @@
{
"componentName": "Astrid Hofferson",
"componentDescription": "",
- "characterSpecificTemplateSystems": [
+ "characterSpecificTemplateSystems": [],
+ "characterRelationGamesystems": [
{
- "componentName": "TemplateGamesystem",
+ "componentName": "Characterbeziehungssystem",
"states": [
{
- "stateLabel": "A",
- "conditionMap": [
- {
- "scriptAccount": "Luftfeuchtigkeit",
- "minValue": 0,
- "maxValue": "10"
- }
- ]
+ "stateLabel": "Feind",
+ "conditionMap": [],
+ "initialMap": true
},
{
- "stateLabel": "B",
- "conditionMap": [
- {
- "scriptAccount": "New ScriptAccount",
- "minValue": 0,
- "maxValue": 100
- }
- ]
+ "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": "A",
- "endingState": "B",
- "conditionMap": [
- {
- "scriptAccount": "Temperature",
- "minValue": 0,
- "maxValue": 10
- }
- ],
- "actionMap": [
- {
- "changingValue": 10,
- "scriptAccount": "Luftfeuchtigkeit"
- }
- ]
+ "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
}
]
}
\ No newline at end of file
diff --git a/testModel/characters/Hicks Haddock.json b/testModel/characters/Hicks Haddock.json
index 158b912..bfb5c9c 100644
--- a/testModel/characters/Hicks Haddock.json
+++ b/testModel/characters/Hicks Haddock.json
@@ -1,60 +1,70 @@
{
"componentName": "Hicks Haddock",
"componentDescription": "",
- "characterSpecificTemplateSystems": [
+ "characterSpecificTemplateSystems": [],
+ "characterRelationGamesystems": [
{
- "componentName": "TemplateGamesystem",
+ "componentName": "Characterbeziehungssystem",
"states": [
{
- "stateLabel": "A",
- "conditionMap": [
- {
- "scriptAccount": "Luftfeuchtigkeit",
- "minValue": 0,
- "maxValue": "10"
- }
- ]
+ "stateLabel": "Feind",
+ "conditionMap": [],
+ "initialMap": false
},
{
- "stateLabel": "B",
- "conditionMap": [
- {
- "scriptAccount": "New ScriptAccount",
- "minValue": 0,
- "maxValue": 100
- }
- ]
+ "stateLabel": "Freund",
+ "conditionMap": [],
+ "initialMap": false
+ },
+ {
+ "stateLabel": "Fester Freund",
+ "conditionMap": [],
+ "initialMap": true
+ },
+ {
+ "stateLabel": "Eltern",
+ "conditionMap": [],
+ "initialMap": false
+ },
+ {
+ "stateLabel": "Geschwister",
+ "conditionMap": [],
+ "initialMap": false
+ },
+ {
+ "stateLabel": "Großeltern",
+ "conditionMap": [],
+ "initialMap": false
}
],
"transitions": [
{
- "startingState": "A",
- "endingState": "B",
+ "startingState": "Feind",
+ "endingState": "Freund",
"conditionMap": [],
"actionMap": []
- }
- ]
- },
- {
- "componentName": "Letters",
- "states": [
- {
- "stateLabel": "A",
- "conditionMap": []
},
{
- "stateLabel": "B",
- "conditionMap": []
- }
- ],
- "transitions": [
+ "startingState": "Freund",
+ "endingState": "Feind",
+ "conditionMap": [],
+ "actionMap": []
+ },
{
- "startingState": "A",
- "endingState": "B",
+ "startingState": "Freund",
+ "endingState": "Fester Freund",
+ "conditionMap": [],
+ "actionMap": []
+ },
+ {
+ "startingState": "Fester Freund",
+ "endingState": "Feind",
"conditionMap": [],
"actionMap": []
}
- ]
+ ],
+ "generateIsolatedStates": true,
+ "symmetric": true
}
]
}
\ No newline at end of file
diff --git a/testModel/gamesystems/Characterbeziehungssystem.json b/testModel/gamesystems/Characterbeziehungssystem.json
new file mode 100644
index 0000000..43ebb7c
--- /dev/null
+++ b/testModel/gamesystems/Characterbeziehungssystem.json
@@ -0,0 +1,71 @@
+{
+ "componentName": "Characterbeziehungssystem",
+ "componentDescription": "",
+ "states": [
+ {
+ "initial": true,
+ "conditions": [],
+ "stateLabel": "Feind",
+ "stateDescription": ""
+ },
+ {
+ "initial": false,
+ "conditions": [],
+ "stateLabel": "Freund",
+ "stateDescription": ""
+ },
+ {
+ "initial": false,
+ "conditions": [],
+ "stateLabel": "Fester Freund",
+ "stateDescription": ""
+ },
+ {
+ "initial": false,
+ "conditions": [],
+ "stateLabel": "Eltern",
+ "stateDescription": ""
+ },
+ {
+ "initial": false,
+ "conditions": [],
+ "stateLabel": "Geschwister",
+ "stateDescription": ""
+ },
+ {
+ "initial": false,
+ "conditions": [],
+ "stateLabel": "Großeltern",
+ "stateDescription": ""
+ }
+ ],
+ "transitions": [
+ {
+ "scriptAccountActions": [],
+ "scriptAccountConditions": [],
+ "startingState": "Feind",
+ "endingState": "Freund"
+ },
+ {
+ "scriptAccountActions": [],
+ "scriptAccountConditions": [],
+ "startingState": "Freund",
+ "endingState": "Feind"
+ },
+ {
+ "scriptAccountActions": [],
+ "scriptAccountConditions": [],
+ "startingState": "Freund",
+ "endingState": "Fester Freund"
+ },
+ {
+ "scriptAccountActions": [],
+ "scriptAccountConditions": [],
+ "startingState": "Fester Freund",
+ "endingState": "Feind"
+ }
+ ],
+ "generateIsolatedStates": true,
+ "symmetric": true,
+ "templateType": 1
+}
\ No newline at end of file
diff --git a/testModel/gamesystems/NormalGamesystem.json b/testModel/gamesystems/NormalGamesystem.json
deleted file mode 100644
index 7525520..0000000
--- a/testModel/gamesystems/NormalGamesystem.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "componentName": "NormalGamesystem",
- "componentDescription": "",
- "states": [],
- "transitions": []
-}
\ No newline at end of file
diff --git a/testModel/gamesystems/ProductGamesystem/Letter.json b/testModel/gamesystems/ProductGamesystem/Letter.json
new file mode 100644
index 0000000..024eea1
--- /dev/null
+++ b/testModel/gamesystems/ProductGamesystem/Letter.json
@@ -0,0 +1,14 @@
+{
+ "componentName": "Letter",
+ "componentDescription": "",
+ "states": [
+ {
+ "initial": false,
+ "conditions": [],
+ "stateLabel": "A",
+ "stateDescription": ""
+ }
+ ],
+ "transitions": [],
+ "generateIsolatedStates": false
+}
\ No newline at end of file
diff --git a/testModel/gamesystems/ProductGamesystem/Number.json b/testModel/gamesystems/ProductGamesystem/Number.json
new file mode 100644
index 0000000..a774068
--- /dev/null
+++ b/testModel/gamesystems/ProductGamesystem/Number.json
@@ -0,0 +1,14 @@
+{
+ "componentName": "Number",
+ "componentDescription": "",
+ "states": [
+ {
+ "initial": false,
+ "conditions": [],
+ "stateLabel": "1",
+ "stateDescription": ""
+ }
+ ],
+ "transitions": [],
+ "generateIsolatedStates": false
+}
\ No newline at end of file
diff --git a/testModel/gamesystems/ProductGamesystem/ProductGamesystem.json b/testModel/gamesystems/ProductGamesystem/ProductGamesystem.json
new file mode 100644
index 0000000..b08af05
--- /dev/null
+++ b/testModel/gamesystems/ProductGamesystem/ProductGamesystem.json
@@ -0,0 +1,13 @@
+{
+ "componentName": "ProductGamesystem",
+ "componentDescription": "",
+ "childsystems": [
+ {
+ "componentName": "Letter"
+ },
+ {
+ "componentName": "Number"
+ }
+ ],
+ "generateIsolatedStates": true
+}
\ No newline at end of file
diff --git a/testModel/gamesystems/Producttest/Letters.json b/testModel/gamesystems/Producttest/Letters.json
deleted file mode 100644
index 9bab958..0000000
--- a/testModel/gamesystems/Producttest/Letters.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "componentName": "Letters",
- "componentDescription": "",
- "states": [
- {
- "initial": false,
- "conditions": [],
- "stateLabel": "A",
- "stateDescription": ""
- },
- {
- "initial": false,
- "conditions": [],
- "stateLabel": "B",
- "stateDescription": ""
- }
- ],
- "transitions": [
- {
- "scriptAccountActions": [],
- "scriptAccountConditions": [],
- "startingState": "A",
- "endingState": "B"
- }
- ],
- "templateType": 0
-}
\ No newline at end of file
diff --git a/testModel/gamesystems/Producttest/Numbers.json b/testModel/gamesystems/Producttest/Numbers.json
deleted file mode 100644
index 89f1e28..0000000
--- a/testModel/gamesystems/Producttest/Numbers.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "componentName": "Numbers",
- "componentDescription": "",
- "states": [
- {
- "initial": false,
- "conditions": [],
- "stateLabel": "1",
- "stateDescription": ""
- },
- {
- "initial": false,
- "conditions": [],
- "stateLabel": "2",
- "stateDescription": ""
- }
- ],
- "transitions": [
- {
- "scriptAccountActions": [],
- "scriptAccountConditions": [],
- "startingState": "1",
- "endingState": "2"
- }
- ]
-}
\ No newline at end of file
diff --git a/testModel/gamesystems/Producttest/Producttest.json b/testModel/gamesystems/Producttest/Producttest.json
deleted file mode 100644
index 239e216..0000000
--- a/testModel/gamesystems/Producttest/Producttest.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "componentName": "Producttest",
- "componentDescription": "",
- "childsystems": [
- {
- "componentName": "Letters"
- },
- {
- "componentName": "Numbers"
- }
- ],
- "templateType": 0
-}
\ No newline at end of file
diff --git a/testModel/gamesystems/TemplateGamesystem.json b/testModel/gamesystems/TemplateGamesystem.json
deleted file mode 100644
index 0a1da3d..0000000
--- a/testModel/gamesystems/TemplateGamesystem.json
+++ /dev/null
@@ -1,50 +0,0 @@
-{
- "componentName": "TemplateGamesystem",
- "componentDescription": "",
- "states": [
- {
- "initial": false,
- "conditions": [
- {
- "scriptAccount": "Luftfeuchtigkeit",
- "minValue": 0,
- "maxValue": "10"
- }
- ],
- "stateLabel": "A",
- "stateDescription": ""
- },
- {
- "initial": false,
- "conditions": [
- {
- "scriptAccount": "New ScriptAccount",
- "minValue": 0,
- "maxValue": 100
- }
- ],
- "stateLabel": "B",
- "stateDescription": ""
- }
- ],
- "transitions": [
- {
- "scriptAccountActions": [
- {
- "changingValue": 10,
- "scriptAccount": "Luftfeuchtigkeit"
- }
- ],
- "scriptAccountConditions": [
- {
- "scriptAccount": "Temperature",
- "minValue": 0,
- "maxValue": 10
- }
- ],
- "startingState": "A",
- "endingState": "B"
- }
- ],
- "templateType": 0
-}
\ No newline at end of file
diff --git a/testModel/gamesystems/Testsystem.json b/testModel/gamesystems/Testsystem.json
deleted file mode 100644
index 654df19..0000000
--- a/testModel/gamesystems/Testsystem.json
+++ /dev/null
@@ -1,37 +0,0 @@
-{
- "componentName": "Testsystem",
- "componentDescription": "",
- "states": [
- {
- "initial": false,
- "conditions": [],
- "stateLabel": "A",
- "stateDescription": ""
- },
- {
- "initial": false,
- "conditions": [],
- "stateLabel": "B",
- "stateDescription": ""
- }
- ],
- "transitions": [
- {
- "scriptAccountActions": [
- {
- "changingValue": 5,
- "scriptAccount": "New ScriptAccount"
- }
- ],
- "scriptAccountConditions": [
- {
- "scriptAccount": "Temperature",
- "minValue": 0,
- "maxValue": "10"
- }
- ],
- "startingState": "A",
- "endingState": "B"
- }
- ]
-}
\ No newline at end of file
diff --git a/testModel/gamesystems/Weathersystem/Season.json b/testModel/gamesystems/Weathersystem/Season.json
deleted file mode 100644
index a815ccb..0000000
--- a/testModel/gamesystems/Weathersystem/Season.json
+++ /dev/null
@@ -1,80 +0,0 @@
-{
- "componentName": "Season",
- "componentDescription": "Ein simples Gamesystem zur Modellierung verschiedener Jahreszeiten und deren Übergänge",
- "states": [
- {
- "initial": true,
- "conditions": [
- {
- "scriptAccount": "Temperature",
- "minValue": 0,
- "maxValue": "10"
- }
- ],
- "stateLabel": "Frühling",
- "stateDescription": ""
- },
- {
- "initial": false,
- "conditions": [
- {
- "scriptAccount": "Temperature",
- "minValue": "10",
- "maxValue": "30"
- }
- ],
- "stateLabel": "Sommer",
- "stateDescription": ""
- },
- {
- "initial": false,
- "conditions": [
- {
- "scriptAccount": "Temperature",
- "minValue": "10",
- "maxValue": "20"
- }
- ],
- "stateLabel": "Herbst",
- "stateDescription": ""
- },
- {
- "initial": false,
- "conditions": [
- {
- "scriptAccount": "Temperature",
- "minValue": "-10",
- "maxValue": "10"
- }
- ],
- "stateLabel": "Winter",
- "stateDescription": ""
- }
- ],
- "transitions": [
- {
- "scriptAccountActions": [],
- "scriptAccountConditions": [],
- "startingState": "Frühling",
- "endingState": "Sommer"
- },
- {
- "scriptAccountActions": [],
- "scriptAccountConditions": [],
- "startingState": "Sommer",
- "endingState": "Herbst"
- },
- {
- "scriptAccountActions": [],
- "scriptAccountConditions": [],
- "startingState": "Herbst",
- "endingState": "Winter"
- },
- {
- "scriptAccountActions": [],
- "scriptAccountConditions": [],
- "startingState": "Winter",
- "endingState": "Frühling"
- }
- ]
-}
\ No newline at end of file
diff --git a/testModel/gamesystems/Weathersystem/Weather.json b/testModel/gamesystems/Weathersystem/Weather.json
deleted file mode 100644
index b9de825..0000000
--- a/testModel/gamesystems/Weathersystem/Weather.json
+++ /dev/null
@@ -1,80 +0,0 @@
-{
- "componentName": "Weather",
- "componentDescription": "A small Gamesystem about local weather events",
- "states": [
- {
- "initial": true,
- "conditions": [],
- "stateLabel": "Sonne",
- "stateDescription": ""
- },
- {
- "initial": false,
- "conditions": [
- {
- "scriptAccount": "Temperature",
- "minValue": 0,
- "maxValue": "30"
- }
- ],
- "stateLabel": "Regen",
- "stateDescription": ""
- },
- {
- "initial": false,
- "conditions": [],
- "stateLabel": "Wolke",
- "stateDescription": ""
- },
- {
- "initial": false,
- "conditions": [
- {
- "scriptAccount": "Temperature",
- "minValue": "-5",
- "maxValue": 0
- }
- ],
- "stateLabel": "Schnee",
- "stateDescription": ""
- }
- ],
- "transitions": [
- {
- "scriptAccountActions": [],
- "scriptAccountConditions": [],
- "startingState": "Sonne",
- "endingState": "Wolke"
- },
- {
- "scriptAccountActions": [],
- "scriptAccountConditions": [],
- "startingState": "Wolke",
- "endingState": "Sonne"
- },
- {
- "scriptAccountActions": [],
- "scriptAccountConditions": [],
- "startingState": "Wolke",
- "endingState": "Regen"
- },
- {
- "scriptAccountActions": [],
- "scriptAccountConditions": [],
- "startingState": "Regen",
- "endingState": "Wolke"
- },
- {
- "scriptAccountActions": [],
- "scriptAccountConditions": [],
- "startingState": "Wolke",
- "endingState": "Schnee"
- },
- {
- "scriptAccountActions": [],
- "scriptAccountConditions": [],
- "startingState": "Schnee",
- "endingState": "Wolke"
- }
- ]
-}
\ No newline at end of file
diff --git a/testModel/gamesystems/Weathersystem/Weathersystem.json b/testModel/gamesystems/Weathersystem/Weathersystem.json
deleted file mode 100644
index b9abfec..0000000
--- a/testModel/gamesystems/Weathersystem/Weathersystem.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "componentName": "Weathersystem",
- "componentDescription": "Ein Wettersystem, dass sich aus normalem Wetter (Sonne, Regen, Wolke, Schnee, Sturm etc.) und zusätzlich den Jahreszeiten (Frühling, Sommer, Herbst, Winter, etc.) zusammensetzt.",
- "childsystems": [
- {
- "componentName": "Season"
- },
- {
- "componentName": "Weather"
- }
- ]
-}
\ No newline at end of file
diff --git a/testModel/script-accounts/New ScriptAccount.json b/testModel/script-accounts/New ScriptAccount.json
deleted file mode 100644
index c4a4176..0000000
--- a/testModel/script-accounts/New ScriptAccount.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "componentName": "New ScriptAccount",
- "componentDescription": "",
- "minValue": 0,
- "maxValue": 100
-}
\ No newline at end of file
diff --git a/testModel/script-accounts/Temperature.json b/testModel/script-accounts/Temperature.json
deleted file mode 100644
index 91a3a6c..0000000
--- a/testModel/script-accounts/Temperature.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "componentName": "Temperature",
- "componentDescription": "",
- "minValue": -30,
- "maxValue": 50
-}
\ No newline at end of file
diff --git a/testModel/script-accounts/Luftfeuchtigkeit.json b/testModel/script-accounts/Test.json
similarity index 63%
rename from testModel/script-accounts/Luftfeuchtigkeit.json
rename to testModel/script-accounts/Test.json
index b4593b2..b444bb6 100644
--- a/testModel/script-accounts/Luftfeuchtigkeit.json
+++ b/testModel/script-accounts/Test.json
@@ -1,5 +1,5 @@
{
- "componentName": "Luftfeuchtigkeit",
+ "componentName": "Test",
"componentDescription": "",
"minValue": 0,
"maxValue": 100
|