summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Rohdewald <wolfgang@rohdewald.de>2015-11-23 12:03:58 (GMT)
committerWolfgang Rohdewald <wolfgang@rohdewald.de>2016-08-24 11:47:06 (GMT)
commit9706bfc948522403c7de1383c94d0a175b2ac2e5 (patch)
treedbb1009b8bdd7e1558f31b97f0c274302ffc850d
parent9b0757c75d7866f4ac78a7298c3bc999d92ad633 (diff)
Player: rename arg withTile to withDiscard
-rw-r--r--src/player.py14
-rw-r--r--src/scoring.py2
2 files changed, 8 insertions, 8 deletions
diff --git a/src/player.py b/src/player.py
index dbc7dc3..09b8771 100644
--- a/src/player.py
+++ b/src/player.py
@@ -389,24 +389,24 @@ class Player(StrMixin):
self._concealedTiles[0] = tileName
self._hand = None
- def computeHand(self, withTile=None):
+ def computeHand(self, withDiscard=None):
"""returns Hand for this player"""
assert not (self._concealedMelds and self._concealedTiles)
assert isinstance(self.lastTile, (Tile, type(None)))
- assert isinstance(withTile, (Tile, type(None)))
+ assert isinstance(withDiscard, (Tile, type(None)))
melds = ['R' + ''.join(str(x) for x in sorted(self._concealedTiles))]
- if withTile:
- melds[0] += withTile
+ if withDiscard:
+ melds[0] += withDiscard
if melds[0] == 'R':
melds = melds[1:]
melds.extend(str(x) for x in self._exposedMelds)
melds.extend(str(x) for x in self._concealedMelds)
melds.extend(str(x) for x in self._bonusTiles)
melds.append(self.mjString())
- if withTile or self.lastTile:
+ if withDiscard or self.lastTile:
melds.append(
'L%s%s' %
- (withTile or self.lastTile, self.lastMeld if self.lastMeld else ''))
+ (withDiscard or self.lastTile, self.lastMeld if self.lastMeld else ''))
return Hand(self, ' '.join(melds))
def scoringString(self):
@@ -566,7 +566,7 @@ class PlayingPlayer(Player):
withDiscard = game.lastDiscard
else:
withDiscard = None
- hand = self.computeHand(withTile=withDiscard)
+ hand = self.computeHand(withDiscard)
if hand.won:
if Debug.robbingKong:
if move.message == Message.DeclaredKong:
diff --git a/src/scoring.py b/src/scoring.py
index 7184578..7e147e8 100644
--- a/src/scoring.py
+++ b/src/scoring.py
@@ -423,7 +423,7 @@ class ScoringPlayer(VisiblePlayer, Player):
return ''
return 'L%s%s' % (self.lastTile, self.lastMeld)
- def computeHand(self, dummyWithTile=None):
+ def computeHand(self, dummyWithDiscard=None):
"""returns a Hand object, using a cache"""
self.lastTile = Internal.scene.computeLastTile()
self.lastMeld = Internal.scene.computeLastMeld()