From 9d565aad35f2975c58413154a6b04ac094a09f48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Fri, 12 Apr 2024 18:54:02 +0200 Subject: [PATCH] Refactor Generation from Childsystems to allow seperation between product and producttemplate --- .../AbstractProductGamesystemGenerator.ts | 11 ++++------ .../ProductGamesystemGenerator.ts | 6 ++++++ .../ProductTemplateGamesystemGenerator.ts | 20 +++++++++++++++++++ 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/src/app/project/game-model/gamesystems/productSystemGenerator/AbstractProductGamesystemGenerator.ts b/src/app/project/game-model/gamesystems/productSystemGenerator/AbstractProductGamesystemGenerator.ts index 4278ed5..dbe31ff 100644 --- a/src/app/project/game-model/gamesystems/productSystemGenerator/AbstractProductGamesystemGenerator.ts +++ b/src/app/project/game-model/gamesystems/productSystemGenerator/AbstractProductGamesystemGenerator.ts @@ -24,25 +24,22 @@ export abstract class AbstractProductGamesystemGenerator { const rightInitialData = this.prepareChildsystemForGeneration(this.productGamesystem.innerGamesystems[1]) const initialGenerationResult = this.generateFromBinaryChildsystems(leftInitialData, rightInitialData); - console.log("Debug msg2") if(this.productGamesystem.innerGamesystems.length > 2) { - console.log("Deeper construction") for(let i=2; i) { if(childsystem instanceof ProductGamesystem) { childsystem.productGamesystemGenerator.generateFromChildsystems(); diff --git a/src/app/project/game-model/gamesystems/productSystemGenerator/ProductGamesystemGenerator.ts b/src/app/project/game-model/gamesystems/productSystemGenerator/ProductGamesystemGenerator.ts index 908dece..1744f7e 100644 --- a/src/app/project/game-model/gamesystems/productSystemGenerator/ProductGamesystemGenerator.ts +++ b/src/app/project/game-model/gamesystems/productSystemGenerator/ProductGamesystemGenerator.ts @@ -9,9 +9,15 @@ import {ProductTransition} from "../transitions/ProductTransition"; import {Transition} from "../transitions/Transition"; import {ScriptAccountAction} from "../actions/ScriptAccountAction"; import {AbstractProductGamesystemGenerator} from "./AbstractProductGamesystemGenerator"; +import {transition} from "@angular/animations"; +import * as console from "node:console"; export class ProductGamesystemGenerator extends AbstractProductGamesystemGenerator { + 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[]) { const transition = new ProductTransition(startingState, endingState); diff --git a/src/app/project/game-model/gamesystems/productSystemGenerator/ProductTemplateGamesystemGenerator.ts b/src/app/project/game-model/gamesystems/productSystemGenerator/ProductTemplateGamesystemGenerator.ts index ff35cd3..e98b031 100644 --- a/src/app/project/game-model/gamesystems/productSystemGenerator/ProductTemplateGamesystemGenerator.ts +++ b/src/app/project/game-model/gamesystems/productSystemGenerator/ProductTemplateGamesystemGenerator.ts @@ -1,5 +1,25 @@ import {AbstractProductGamesystemGenerator} from "./AbstractProductGamesystemGenerator"; +import {State} from "../states/State"; +import {ProductState} from "../states/ProductState"; +import {Transition} from "../transitions/Transition"; +import {ProductTransition} from "../transitions/ProductTransition"; +import {ProductGeneratorResult} from "./ProductGeneratorResult"; export class ProductTemplateGamesystemGenerator extends AbstractProductGamesystemGenerator{ + protected assignGeneratedStatesAndTransitions(generationResult: ProductGeneratorResult): void { + } + + protected generateBinaryProductState(leftState: State, rightState: State, generadedStates: ProductState[]): ProductState | undefined { + return undefined; + } + + protected generateBinaryProductTransition(leftState: State, rightState: State, usedTransition: Transition, generatedTransitions: ProductTransition[]): void { + } + + protected generateBinaryProductTransitionMulti(leftState: State, rightState: State, leftTransition: Transition, rightTransition: Transition, generatedTransitions: ProductTransition[]): void { + } + + + }