Introduce Symetric and Asymetric Template Relation Systems #40

Merged
sebastian merged 23 commits from assymetric-template-relation-systems into template-systems 2024-04-19 20:04:54 +02:00
3 changed files with 12 additions and 4 deletions
Showing only changes of commit 87a0dd775e - Show all commits

View File

@ -1,3 +1,4 @@
<mat-checkbox [(ngModel)]="this.gamesystem!.generateIsolatedStates">Generate Isolated States</mat-checkbox>
<app-product-state-editor [templateElement]="templateElement" [gamesystem]="gamesystem" (onOpenGamesystemEditor)="onOpenGamesystemEditor($event)"></app-product-state-editor>
<div id="productStateEditor">
<app-product-transition-editor [templateElement]="templateElement" [gamesystem]="gamesystem" (onOpenGamesystem)="onOpenGamesystemEditor($event)"></app-product-transition-editor>

View File

@ -16,6 +16,7 @@ import {IsolatedProductStateGenerator} from "./productSystemGenerator/IsolatedPr
export class ProductGamesystem extends Gamesystem<ProductState, ProductTransition> {
innerGamesystems: Gamesystem<State<any>, Transition<any>>[] = [];
generateIsolatedStates: boolean = false
static constructFromSimpleGamesystem(simpleGamesystem: SimpleGamesystem, gameModel: GameModel) {
const productGamesystem = new ProductGamesystem(simpleGamesystem.componentName, simpleGamesystem.componentDescription);
@ -76,9 +77,11 @@ export class ProductGamesystem extends Gamesystem<ProductState, ProductTransitio
const productGenerator = new ProductSystemGenerator(this);
productGenerator.generateFromChildsystems();
if(this.generateIsolatedStates) {
const isolatedStatesGenerator = new IsolatedProductStateGenerator(this);
isolatedStatesGenerator.generateIsolatedProductStates();
}
}
addChildGamesystem(gamesystem: Gamesystem<State<any>, Transition<any>>) {
this.innerGamesystems.push(gamesystem);

View File

@ -32,10 +32,14 @@ export class ProductTemplateSystem extends ProductGamesystem implements Template
} else {
const productTemplateGenerator = new TemplateProductSystemGenerator(this, templateElement);
productTemplateGenerator.generateFromChildsystems()
}
if(this.generateIsolatedStates) {
const isolatedTemplateStateGenerator = new IsolatedTemplateStateGenerator(this, templateElement);
isolatedTemplateStateGenerator.generateIsolatedProductStates();
}
}
}
}