Commit 9706bfc9 authored by Wolfgang Rohdewald's avatar Wolfgang Rohdewald
Browse files

Player: rename arg withTile to withDiscard

parent 9b0757c7
......@@ -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:
......
......@@ -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()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment