summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2016-06-03 12:35:34 +0200
committeremkael <emkael@tlen.pl>2016-06-03 12:35:34 +0200
commit2b390ec5ae5c93a40a480a124c2cac8c90b61f9d (patch)
treef814d3a0e9c5ccc7489ab87bef57ee777223c00b
parentc2d8fb32ecc0cae6432c046e0dc960343ade49f9 (diff)
* level 8 sacrifice is illegal
-rw-r--r--src/ParContract.cs15
1 files 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);
+ }
}
}
}