diff frontends/quick_frontend/quick_app.py @ 92:2503de7fb4c7

Tarot game: chien/écart stage - tarot plugin: new methods/signals tarotGamePlayCards, tarotGameShowCards, tarotGameYourTurn - tarot plugin: protocole update - tarot plugin: family renamed in suit - wix: card_game: card can be selected for écart, card move when mouse is over only if it's our turn
author Goffi <goffi@goffi.org>
date Sat, 29 May 2010 20:53:03 +0930
parents 39c672544593
children 2f87651a5ad8
line wrap: on
line diff
--- a/frontends/quick_frontend/quick_app.py	Thu May 27 19:26:19 2010 +0930
+++ b/frontends/quick_frontend/quick_app.py	Sat May 29 20:53:03 2010 +0930
@@ -50,7 +50,9 @@
         self.bridge.register("roomNewSubject", self.roomNewSubject)
         self.bridge.register("tarotGameStarted", self.tarotGameStarted)
         self.bridge.register("tarotGameNew", self.tarotGameNew)
-        self.bridge.register("tarotChooseContrat", self.tarotChooseContrat)
+        self.bridge.register("tarotGameChooseContrat", self.tarotChooseContrat)
+        self.bridge.register("tarotGameShowCards", self.tarotShowCards)
+        self.bridge.register("tarotGameYourTurn", self.tarotMyTurn)
         self.bridge.register("subscribe", self.subscribe)
         self.bridge.register("paramUpdate", self.paramUpdate)
         self.bridge.register("contactDeleted", self.contactDeleted)
@@ -291,7 +293,19 @@
         if self.chat_wins.has_key(room_jid):
             self.chat_wins[room_jid].getGame("Tarot").chooseContrat(xml_data)
 
+    def tarotShowCards(self, room_jid, game_stage, cards, data, profile):
+        if not self.__check_profile(profile):
+            return
+        debug (_("Show cards"))
+        if self.chat_wins.has_key(room_jid):
+            self.chat_wins[room_jid].getGame("Tarot").showCards(game_stage, cards, data)
 
+    def tarotMyTurn(self, room_jid, profile):
+        if not self.__check_profile(profile):
+            return
+        debug (_("My turn to play"))
+        if self.chat_wins.has_key(room_jid):
+            self.chat_wins[room_jid].getGame("Tarot").MyTurn()
 
     def subscribe(self, type, raw_jid, profile):
         """Called when a subsciption management signal is received"""