From 2b390ec5ae5c93a40a480a124c2cac8c90b61f9d Mon Sep 17 00:00:00 2001 From: emkael Date: Fri, 3 Jun 2016 12:35:34 +0200 Subject: * level 8 sacrifice is illegal --- src/ParContract.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/ParContract.cs b/src/ParContract.cs index 313f5b9..d767f0e 100644 --- a/src/ParContract.cs +++ b/src/ParContract.cs @@ -189,15 +189,18 @@ namespace BCDD { level++; } - foreach (int defender in defendersIndexes) + if (level <= 7) { - if (level + 6 > ddTable[defender, i]) + foreach (int defender in defendersIndexes) { - ParContract defense = new ParContract(level, BCalcWrapper.DENOMINATIONS[i], BCalcWrapper.PLAYERS[defender], true, 0); - defense.Score = defense.CalculateScore(ddTable[defender, i], vulnerable); - if (scoreSquared > this.Score * defense.Score) + if (level + 6 > ddTable[defender, i]) { - possibleDefense.Add(defense); + ParContract defense = new ParContract(level, BCalcWrapper.DENOMINATIONS[i], BCalcWrapper.PLAYERS[defender], true, 0); + defense.Score = defense.CalculateScore(ddTable[defender, i], vulnerable); + if (scoreSquared > this.Score * defense.Score) + { + possibleDefense.Add(defense); + } } } } -- cgit v1.2.3