comparison frontends/quick_frontend/quick_app.py @ 99:63c9067a1499

Tarot game: invalid cards management - tarot plugin: card validity check, new signal tarotGameInvalidCards - wix: when an invalid cards signal is received, the cards are back in the hand, and the state change so the player as to play again.
author Goffi <goffi@goffi.org>
date Fri, 18 Jun 2010 15:19:32 +0800
parents be206a3d1a9b
children 94011f553cd0
comparison
equal deleted inserted replaced
98:dd556233a1b1 99:63c9067a1499
53 self.bridge.register("tarotGameChooseContrat", self.tarotChooseContrat) 53 self.bridge.register("tarotGameChooseContrat", self.tarotChooseContrat)
54 self.bridge.register("tarotGameShowCards", self.tarotShowCards) 54 self.bridge.register("tarotGameShowCards", self.tarotShowCards)
55 self.bridge.register("tarotGameYourTurn", self.tarotMyTurn) 55 self.bridge.register("tarotGameYourTurn", self.tarotMyTurn)
56 self.bridge.register("tarotGameScore", self.tarotScore) 56 self.bridge.register("tarotGameScore", self.tarotScore)
57 self.bridge.register("tarotGameCardsPlayed", self.tarotCardsPlayed) 57 self.bridge.register("tarotGameCardsPlayed", self.tarotCardsPlayed)
58 self.bridge.register("tarotGameInvalidCards", self.tarotInvalidCards)
58 self.bridge.register("subscribe", self.subscribe) 59 self.bridge.register("subscribe", self.subscribe)
59 self.bridge.register("paramUpdate", self.paramUpdate) 60 self.bridge.register("paramUpdate", self.paramUpdate)
60 self.bridge.register("contactDeleted", self.contactDeleted) 61 self.bridge.register("contactDeleted", self.contactDeleted)
61 self.bridge.register("updatedValue", self.updatedValue, "request") 62 self.bridge.register("updatedValue", self.updatedValue, "request")
62 self.bridge.register("askConfirmation", self.askConfirmation, "request") 63 self.bridge.register("askConfirmation", self.askConfirmation, "request")
321 if not self.__check_profile(profile): 322 if not self.__check_profile(profile):
322 return 323 return
323 debug (_("Card(s) played (%(player)s): %(cards)s") % {"player":player, "cards":cards}) 324 debug (_("Card(s) played (%(player)s): %(cards)s") % {"player":player, "cards":cards})
324 if self.chat_wins.has_key(room_jid): 325 if self.chat_wins.has_key(room_jid):
325 self.chat_wins[room_jid].getGame("Tarot").cardsPlayed(player, cards) 326 self.chat_wins[room_jid].getGame("Tarot").cardsPlayed(player, cards)
327
328 def tarotInvalidCards(self, room_jid, phase, played_cards, invalid_cards, profile):
329 if not self.__check_profile(profile):
330 return
331 debug (_("Cards played are not valid: %s") % invalid_cards)
332 if self.chat_wins.has_key(room_jid):
333 self.chat_wins[room_jid].getGame("Tarot").invalidCards(phase, played_cards, invalid_cards)
326 334
327 def subscribe(self, type, raw_jid, profile): 335 def subscribe(self, type, raw_jid, profile):
328 """Called when a subsciption management signal is received""" 336 """Called when a subsciption management signal is received"""
329 if not self.__check_profile(profile): 337 if not self.__check_profile(profile):
330 return 338 return