Commit 73e103ea authored by Wolfgang Rohdewald's avatar Wolfgang Rohdewald
Browse files

Player.computeHand renamed to Player._computeHand

parent e2c5a2da
......@@ -227,7 +227,7 @@ class Player(StrMixin):
"""a readonly tuple"""
# TODO: str or what?
if not self._hand:
self._hand = self.computeHand()
self._hand = self._computeHand()
return self._hand
@property
......@@ -388,7 +388,7 @@ class Player(StrMixin):
self._concealedTiles[0] = tileName
self._hand = None
def computeHand(self, withDiscard=None):
def _computeHand(self, withDiscard=None):
"""returns Hand for this player"""
assert not (self._concealedMelds and self._concealedTiles)
melds = ['R' + ''.join(str(x) for x in sorted(self._concealedTiles))]
......@@ -569,7 +569,7 @@ class PlayingPlayer(Player):
withDiscard = game.lastDiscard
else:
withDiscard = None
hand = self.computeHand(withDiscard)
hand = self._computeHand(withDiscard)
if hand.won:
if Debug.robbingKong:
if move.message == Message.DeclaredKong:
......
......@@ -390,7 +390,7 @@ class ScoringPlayer(VisiblePlayer, Player):
try:
checked = box.isChecked()
box.setChecked(not checked)
newHand = self.computeHand()
newHand = self._computeHand()
finally:
box.setChecked(checked)
return newHand.score > currentScore
......@@ -423,7 +423,7 @@ class ScoringPlayer(VisiblePlayer, Player):
return ''
return 'L%s%s' % (self.lastTile, self.lastMeld)
def computeHand(self, dummyWithDiscard=None):
def _computeHand(self):
"""returns a Hand object, using a cache"""
self.lastTile = Internal.scene.computeLastTile()
self.lastMeld = Internal.scene.computeLastMeld()
......
......@@ -1076,7 +1076,7 @@ class ScoringDialog(QWidget):
nameLabel.setBuddy(wonBox)
for loop in range(10):
prevTotal = player.handTotal
handContent = player.computeHand()
handContent = player._computeHand()
wonBox.setVisible(handContent.won)
if not wonBox.isVisibleTo(self) and wonBox.isChecked():
wonBox.setChecked(False)
......
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