Fixing the object issue when iterating over nicks

This commit is contained in:
James Scott 2012-12-13 23:33:27 -05:00
parent c9d085cb46
commit 05630712d6
1 changed files with 6 additions and 6 deletions

View File

@ -81,13 +81,13 @@ class Cah(callbacks.Plugin):
cah = self.game
self._msg(recip, response % cah.question.text)
def _msgHandToPlayer(self, player):
def _msgHandToPlayer(self, nick, hand):
response = "Your cards: %s Please respond with @card <number> [number]"
enumeratedHand = []
for position, card in enumerate(player.card_list):
for position, card in enumerate(hand.card_list):
enumeratedHand.append("%s: %s" % (position + 1, card.txt))
self._printBlackCard(player.name)
self._msg(player, response % ', '.join(enumeratedHand))
self._printBlackCard(nick)
self._msg(nick, response % ', '.join(enumeratedHand))
def _tallyVotes(self, votes):
talliedVotes = {}
@ -146,8 +146,8 @@ class Cah(callbacks.Plugin):
cah.next_round()
#Print Black Card to channel.
self._printBlackCard(self.channel)
for player in cah.players:
self._msgHandToPlayer(player)
for nick, hand in enumerate(cah.players):
self._msgHandToPlayer(nick, hand)
self._msg(channel, "The white cards have been PMed to the players, you have 60 seconds to choose.")
#TODO: do we need a round flag?
schedule.addEvent(self.endround, time.time() + 60, "round_%s" % channel)