Commit ebccfaed authored by Wolfgang Rohdewald's avatar Wolfgang Rohdewald
Browse files

Debug.mahJongg: more output

parent 9d85bd21
......@@ -568,7 +568,10 @@ class Hand(object):
matchingMJRules = [
x for x in matchingMJRules
if 'mayrobhiddenkong' in x.options]
return sorted(matchingMJRules, key=lambda x: -x.score.total())
result = sorted(matchingMJRules, key=lambda x: -x.score.total())
if Debug.mahJongg:
self.debug(u'Hand {}: found matching MJRules:{}'.format(self,matchingMJRules))
return result
def __arrangements(self):
"""find all legal arrangements"""
......
......@@ -477,6 +477,10 @@ class PlayingPlayer(Player):
def declaredMahJongg(self, concealed, withDiscard, lastTile, lastMeld):
"""player declared mah jongg. Determine last meld, show concealed tiles grouped to melds"""
if Debug.mahJongg:
self.game.debug('{} declared MJ: concealed={}, withDiscard={}, lastTile={},lastMeld={}'.format(
self, concealed, withDiscard, lastTile, lastMeld))
self.game.debug(' with hand being {}'.format(self.hand))
melds = concealed[:]
self.game.winner = self
if withDiscard:
......@@ -499,6 +503,9 @@ class PlayingPlayer(Player):
self._concealedMelds = melds
self._concealedTiles = []
self._hand = None
if Debug.mahJongg:
self.game.debug(' hand becomes {}'.format(self.hand))
self._hand = None
def __possibleChows(self):
"""returns a unique list of lists with possible claimable chow combinations"""
......@@ -571,6 +578,7 @@ class PlayingPlayer(Player):
if Debug.mahJongg:
game.debug('%s may say MJ:%s, active=%s' % (
self, list(x for x in game.players), game.activePlayer))
game.debug(' with hand {}'.format(hand))
return MeldList(x for x in hand.melds if not x.isDeclared), withDiscard, hand.lastMeld
def __maySayOriginalCall(self):
......
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