Просмотр исходного кода

add trade token scoring. partially addresses #1

George C. Privon 7 лет назад
Родитель
Сommit
ee64e75461
2 измененных файлов с 9 добавлено и 3 удалено
  1. 1 0
      CHANGELOG.md
  2. 8 3
      cgame.py

+ 1 - 0
CHANGELOG.md

@@ -8,6 +8,7 @@
 
 
 * add a configuration file specifying the database location
 * add a configuration file specifying the database location
 * add a utilities directory for scripts which should not be needed for normal operation but may be useful for working around issues.
 * add a utilities directory for scripts which should not be needed for normal operation but may be useful for working around issues.
+* add scoring capability for Trade tokens (Traders & Builders Expanion). Token allocation is not automatically tracked (this can be tracked manually using the scoring comments). Trade token scores are entered during the post-game scoring period.
 
 
 ## 0.3 Series
 ## 0.3 Series
 
 

+ 8 - 3
cgame.py

@@ -170,7 +170,9 @@ class cgame:
 
 
     def getExpansions(self):
     def getExpansions(self):
         """
         """
-        Get a list of playable expansions
+        Get a list of playable expansions.
+        Ask the user which ones are active.
+        Based on the list, add token, tile, and score types to the basic list.
         """
         """
 
 
         self.expansionIDs = []
         self.expansionIDs = []
@@ -295,7 +297,9 @@ class cgame:
 
 
         # see which token scored
         # see which token scored
         # really this should be expanded to allow multiple token types for one score
         # really this should be expanded to allow multiple token types for one score
-        if len(self.tokens) > 1:
+        if score['scoretype'] == 'Trade token':
+            score['tokens'] = 'none'
+        elif len(self.tokens) > 1:
             VALID = False
             VALID = False
             while not VALID:
             while not VALID:
                 for i, token in enumerate(self.tokens):
                 for i, token in enumerate(self.tokens):
@@ -444,8 +448,9 @@ class cgame:
             self.commands = [('r', 'record score'),
             self.commands = [('r', 'record score'),
                              ('e', 'end game (or end play if already in postgame scoring)'),
                              ('e', 'end game (or end play if already in postgame scoring)'),
                              ('s', '(current) score and game status')]
                              ('s', '(current) score and game status')]
+            # add trade token scoring to the game scoring options
             if 2 in self.expansionIDs:
             if 2 in self.expansionIDs:
-                self.commands.append(('t', 'score trade goods'))
+                self.scoretypes.append('Trade token')
             self.commands.append(('?', 'print help'))
             self.commands.append(('?', 'print help'))
 
 
             _sys.stdout.write("At the end of regulation... ")
             _sys.stdout.write("At the end of regulation... ")