summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Rohdewald <wolfgang@rohdewald.de>2015-11-30 09:28:17 (GMT)
committerWolfgang Rohdewald <wolfgang@rohdewald.de>2016-08-25 06:41:37 (GMT)
commit73e103ea2cae916c5b6d322e2ac663a00f4f6a24 (patch)
treeff1360bf96d4ab0070cfc4d519abf5b9bb8b2a51
parente2c5a2dace10563166af06f1bf3fa46b6dd0e5a7 (diff)
Player.computeHand renamed to Player._computeHand
-rw-r--r--src/player.py6
-rw-r--r--src/scoring.py4
-rw-r--r--src/scoringdialog.py2
3 files changed, 6 insertions, 6 deletions
diff --git a/src/player.py b/src/player.py
index bc20c3e..9013319 100644
--- a/src/player.py
+++ b/src/player.py
@@ -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:
diff --git a/src/scoring.py b/src/scoring.py
index 171056b..1c6c42c 100644
--- a/src/scoring.py
+++ b/src/scoring.py
@@ -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()
diff --git a/src/scoringdialog.py b/src/scoringdialog.py
index 8e13032..729611f 100644
--- a/src/scoringdialog.py
+++ b/src/scoringdialog.py
@@ -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)