diff options
Diffstat (limited to 'src/bcdd/PBNBoard.py')
-rw-r--r-- | src/bcdd/PBNBoard.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/bcdd/PBNBoard.py b/src/bcdd/PBNBoard.py index 87105f2..6e1abf6 100644 --- a/src/bcdd/PBNBoard.py +++ b/src/bcdd/PBNBoard.py @@ -1,6 +1,5 @@ import re -from .BCalcWrapper import BCalcWrapper from .Exceptions import FieldNotFoundException, DDTableInvalidException @@ -19,6 +18,9 @@ class PBNBoard(object): optimum_result_table_pattern = re.compile( r'^([NESW])\s+([CDHSN])T?\s+(\d+)$') + DENOMINATIONS = [ 'C', 'D', 'H', 'S', 'N' ] + PLAYERS = [ 'N', 'E', 'S', 'W' ] + def __init__(self, lines, line_no=None): self.line_number = line_no self._has_optimum_result_table = None @@ -98,7 +100,7 @@ class PBNBoard(object): def write_ability(self, dd_table): sb = '' for i in range(0, 4): - sb += BCalcWrapper.PLAYERS[i] + sb += PBNBoard.PLAYERS[i] sb += ':' sb += ''.join(['%X' % (j) for j in dd_table[i]])[::-1] sb += ' ' @@ -206,9 +208,9 @@ class PBNBoard(object): for j in range(0, 5): self.fields.append(PBNField( raw_data='%s %s%s %d' % ( - BCalcWrapper.PLAYERS[i], - BCalcWrapper.DENOMINATIONS[j], - 'T' if BCalcWrapper.DENOMINATIONS[j] == 'N' else '', + PBNBoard.PLAYERS[i], + PBNBoard.DENOMINATIONS[j], + 'T' if PBNBoard.DENOMINATIONS[j] == 'N' else '', dd_table[i][j]))) def save_par_contract(self, contract, jfr_only=False): |