From b18b06e0930968237e5975105aac3b7678497a83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Fri, 12 Apr 2024 18:46:14 +0200 Subject: [PATCH] Add Transition to generated transitions also in case where left and right state change --- .../productSystemGenerator/ProductGamesystemGenerator.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/project/game-model/gamesystems/productSystemGenerator/ProductGamesystemGenerator.ts b/src/app/project/game-model/gamesystems/productSystemGenerator/ProductGamesystemGenerator.ts index a5a16cf..7538949 100644 --- a/src/app/project/game-model/gamesystems/productSystemGenerator/ProductGamesystemGenerator.ts +++ b/src/app/project/game-model/gamesystems/productSystemGenerator/ProductGamesystemGenerator.ts @@ -18,8 +18,10 @@ export class ProductGamesystemGenerator extends AbstractProductGamesystemGenerat transition.scriptAccountActions = [... usedTransition.scriptAccountActions]; transition.scriptAccountConditions = [... usedTransition.scriptAccountConditions]; - if(generatedTransitions.find(generatedTransition => generatedTransition.equalsTransition(transition)) == undefined) { + if(generatedTransitions.find(generatedTransition => generatedTransition.startingState.equals(startingState) && generatedTransition.endingState.equals(endingState)) == undefined) { generatedTransitions.push(transition) + } else { + console.log(transition) } } @@ -32,10 +34,8 @@ export class ProductGamesystemGenerator extends AbstractProductGamesystemGenerat transition.scriptAccountActions = this.generateCombinedActions(leftTransition.scriptAccountActions, rightTransition.scriptAccountActions); transition.scriptAccountConditions = this.generateCombinedConditions(leftTransition.scriptAccountConditions, rightTransition.scriptAccountConditions); - return transition; + generatedTransitions.push(transition) } - - return undefined; } protected generateBinaryProductState(leftState: State, rightState: State, generatedStates: ProductState[]): ProductState | undefined {