diff --git a/src/app/project/game-model/gamesystems/ProductGamesystem.ts b/src/app/project/game-model/gamesystems/ProductGamesystem.ts index 08f793b..3984e2d 100644 --- a/src/app/project/game-model/gamesystems/ProductGamesystem.ts +++ b/src/app/project/game-model/gamesystems/ProductGamesystem.ts @@ -68,202 +68,8 @@ export class ProductGamesystem extends Gamesystem[] = [this.innerGamesystems[0], this.innerGamesystems[1]]; - if(this.innerGamesystems[0] instanceof ProductGamesystem) { - this.innerGamesystems[0].generateFromChildsystems(); - } - - if(this.innerGamesystems[1] instanceof ProductGamesystem) { - this.innerGamesystems[1].generateFromChildsystems(); - } - let gamesystem: ProductGamesystem = ProductGamesystem.generateFromChildsystems(this.innerGamesystems[0], this.innerGamesystems[1], false, integratedSystems); - - for(let i=2; i, rightSystem: Gamesystem, left_temp: boolean, integratedSystems: Gamesystem[]) { - const productGamesystem = new ProductGamesystem("Temporary Gamesystem", ""); - integratedSystems.forEach(integratedSystem => productGamesystem.addChildGamesystem(integratedSystem)); - - leftSystem.states.forEach(leftState => { - rightSystem.states.forEach(rightState => { - for(let i=0; i, rightInnerState: State, left_temp: boolean) { - const combinedStateConditions: ScriptAccountCondition[] = leftInnerState.conditions.concat(rightInnerState.conditions) - for(let i=0; i[] = []; - if(!left_temp) { - innerStates = [leftInnerState, rightInnerState]; - } else { - const left_inner_product_state = leftInnerState as ProductState; - left_inner_product_state.innerStates.forEach(state => innerStates.push(state)); - innerStates.push(rightInnerState); - } - - - let binary_productState = this.findProductStateByInnerStates(innerStates); - if(binary_productState == undefined) { - binary_productState = this.createState(innerStates)!; - } - - let productInitial = true; - binary_productState.innerStates.forEach(innerState => productInitial = productInitial && innerState.initial) - binary_productState!.initial = productInitial - binary_productState.conditions = combinedStateConditions - - return binary_productState!; + console.log("Debug msg") + this.productGamesystemGenerator.generateFromChildsystems() } addChildGamesystem(gamesystem: Gamesystem, Transition>) { diff --git a/src/app/project/game-model/gamesystems/productSystemGenerator/ProductGamesystemGenerator.ts b/src/app/project/game-model/gamesystems/productSystemGenerator/ProductGamesystemGenerator.ts index b2986cf..ec4fa25 100644 --- a/src/app/project/game-model/gamesystems/productSystemGenerator/ProductGamesystemGenerator.ts +++ b/src/app/project/game-model/gamesystems/productSystemGenerator/ProductGamesystemGenerator.ts @@ -23,15 +23,23 @@ export class ProductGamesystemGenerator { const rightInitialData = this.prepareChildsystemForGeneration(this.productGamesystem.innerGamesystems[1]) const initialGenerationResult = this.generateFromBinaryChildsystems(leftInitialData, rightInitialData); + if(this.productGamesystem.innerGamesystems.length > 2) { + for(let i=2; i) {