Consider state conditions in product state generation
All checks were successful
E2E Testing / test (push) Successful in 1m30s
All checks were successful
E2E Testing / test (push) Successful in 1m30s
This commit is contained in:
parent
777cf9bc1d
commit
530cc5ea67
@ -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!;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user