summaryrefslogtreecommitdiff
path: root/src/bcdd/ParContract.py
diff options
context:
space:
mode:
authorMichał Klichowicz <emkael@tlen.pl>2023-10-01 23:42:10 +0200
committerMichał Klichowicz <emkael@tlen.pl>2023-10-01 23:42:10 +0200
commitb3f00e26049c990f06ab4b1b37345d64f0b5c2ae (patch)
tree820ce5d325e6427645d5af8b160d574b6c453b56 /src/bcdd/ParContract.py
parent7abe5062e8a9cbd41316090e8891fdcbc026696d (diff)
Removing double-dummy code from bcdd PBN parsing code
Diffstat (limited to 'src/bcdd/ParContract.py')
-rw-r--r--src/bcdd/ParContract.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/bcdd/ParContract.py b/src/bcdd/ParContract.py
index 918efae..97ce0d9 100644
--- a/src/bcdd/ParContract.py
+++ b/src/bcdd/ParContract.py
@@ -1,6 +1,6 @@
import functools
-from .BCalcWrapper import BCalcWrapper as bcw
+from .PBNBoard import PBNBoard as pbb
from .Exceptions import ParScoreInvalidException
@@ -100,21 +100,21 @@ class ParContract(object):
return score
def __gt__(self, other):
- denomination = bcw.DENOMINATIONS.index(self.denomination) \
- if self.denomination in bcw.DENOMINATIONS \
+ denomination = pbb.DENOMINATIONS.index(self.denomination) \
+ if self.denomination in pbb.DENOMINATIONS \
else -1
- other_denomination = bcw.DENOMINATIONS.index(
+ other_denomination = pbb.DENOMINATIONS.index(
other.denomination) \
- if other.denomination in bcw.DENOMINATIONS else -1
+ if other.denomination in pbb.DENOMINATIONS else -1
return (self.level > other.level) \
or ((self.level == other.level) \
and (denomination > other_denomination))
def get_defense(self, dd_table, vulnerable):
- declarer_index = bcw.PLAYERS.index(self.declarer) \
- if self.declarer in bcw.PLAYERS else -1
- denomination_index = bcw.DENOMINATIONS.index(self.denomination) \
- if self.denomination in bcw.DENOMINATIONS else -1
+ declarer_index = pbb.PLAYERS.index(self.declarer) \
+ if self.declarer in pbb.PLAYERS else -1
+ denomination_index = pbb.DENOMINATIONS.index(self.denomination) \
+ if self.denomination in pbb.DENOMINATIONS else -1
if (self.level != 0) \
and (self.level + 6
<= dd_table[declarer_index][denomination_index]):
@@ -132,8 +132,8 @@ class ParContract(object):
if level + 6 > dd_table[defender][i]:
defense = ParContract(
level,
- bcw.DENOMINATIONS[i],
- bcw.PLAYERS[defender],
+ pbb.DENOMINATIONS[i],
+ pbb.PLAYERS[defender],
True,
0)
defense.score = defense.calculate_score(