issue-15 #21

Merged
sebastian merged 60 commits from issue-15 into main 2024-03-22 07:46:49 +00:00
Showing only changes of commit 530cc5ea67 - Show all commits

View File

@ -150,6 +150,15 @@ export class ProductGamesystem extends Gamesystem<ProductState, ProductTransitio
} }
generateBinaryProductState(leftInnerState: State<any>, rightInnerState: State<any>, left_temp: boolean) { generateBinaryProductState(leftInnerState: State<any>, rightInnerState: State<any>, left_temp: boolean) {
const combinedStateConditions: ScriptAccountCondition[] = leftInnerState.conditions.concat(rightInnerState.conditions)
for(let i=0; i<combinedStateConditions.length; i++) {
for(let j=0; j<combinedStateConditions.length; j++) {
if(combinedStateConditions[i].isContradicting(combinedStateConditions[j])) {
return undefined
}
}
}
let innerStates: State<any>[] = []; let innerStates: State<any>[] = [];
if(!left_temp) { if(!left_temp) {
innerStates = [leftInnerState, rightInnerState]; innerStates = [leftInnerState, rightInnerState];
@ -168,16 +177,8 @@ export class ProductGamesystem extends Gamesystem<ProductState, ProductTransitio
let productInitial = true; let productInitial = true;
binary_productState.innerStates.forEach(innerState => productInitial = productInitial && innerState.initial) binary_productState.innerStates.forEach(innerState => productInitial = productInitial && innerState.initial)
binary_productState!.initial = productInitial binary_productState!.initial = productInitial
binary_productState.conditions = combinedStateConditions
const combinedStateConditions: ScriptAccountCondition[] = leftInnerState.conditions.concat(rightInnerState.conditions)
const conditionsContradicting = false
for(let i=0; i<combinedStateConditions.length; i++) {
for(let j=0; j<combinedStateConditions.length; j++) {
if(combinedStateConditions[i].isContradicting(combinedStateConditions[j])) {
return undefined
}
}
}
return binary_productState!; return binary_productState!;
} }