comparison 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
comparison
equal deleted inserted replaced
91:39c672544593 92:2503de7fb4c7
48 self.bridge.register("roomUserJoined", self.roomUserJoined) 48 self.bridge.register("roomUserJoined", self.roomUserJoined)
49 self.bridge.register("roomUserLeft", self.roomUserLeft) 49 self.bridge.register("roomUserLeft", self.roomUserLeft)
50 self.bridge.register("roomNewSubject", self.roomNewSubject) 50 self.bridge.register("roomNewSubject", self.roomNewSubject)
51 self.bridge.register("tarotGameStarted", self.tarotGameStarted) 51 self.bridge.register("tarotGameStarted", self.tarotGameStarted)
52 self.bridge.register("tarotGameNew", self.tarotGameNew) 52 self.bridge.register("tarotGameNew", self.tarotGameNew)
53 self.bridge.register("tarotChooseContrat", self.tarotChooseContrat) 53 self.bridge.register("tarotGameChooseContrat", self.tarotChooseContrat)
54 self.bridge.register("tarotGameShowCards", self.tarotShowCards)
55 self.bridge.register("tarotGameYourTurn", self.tarotMyTurn)
54 self.bridge.register("subscribe", self.subscribe) 56 self.bridge.register("subscribe", self.subscribe)
55 self.bridge.register("paramUpdate", self.paramUpdate) 57 self.bridge.register("paramUpdate", self.paramUpdate)
56 self.bridge.register("contactDeleted", self.contactDeleted) 58 self.bridge.register("contactDeleted", self.contactDeleted)
57 self.bridge.register("updatedValue", self.updatedValue, "request") 59 self.bridge.register("updatedValue", self.updatedValue, "request")
58 self.bridge.register("askConfirmation", self.askConfirmation, "request") 60 self.bridge.register("askConfirmation", self.askConfirmation, "request")
289 return 291 return
290 debug (_("Tarot: need to select a contrat")) 292 debug (_("Tarot: need to select a contrat"))
291 if self.chat_wins.has_key(room_jid): 293 if self.chat_wins.has_key(room_jid):
292 self.chat_wins[room_jid].getGame("Tarot").chooseContrat(xml_data) 294 self.chat_wins[room_jid].getGame("Tarot").chooseContrat(xml_data)
293 295
294 296 def tarotShowCards(self, room_jid, game_stage, cards, data, profile):
297 if not self.__check_profile(profile):
298 return
299 debug (_("Show cards"))
300 if self.chat_wins.has_key(room_jid):
301 self.chat_wins[room_jid].getGame("Tarot").showCards(game_stage, cards, data)
302
303 def tarotMyTurn(self, room_jid, profile):
304 if not self.__check_profile(profile):
305 return
306 debug (_("My turn to play"))
307 if self.chat_wins.has_key(room_jid):
308 self.chat_wins[room_jid].getGame("Tarot").MyTurn()
295 309
296 def subscribe(self, type, raw_jid, profile): 310 def subscribe(self, type, raw_jid, profile):
297 """Called when a subsciption management signal is received""" 311 """Called when a subsciption management signal is received"""
298 if not self.__check_profile(profile): 312 if not self.__check_profile(profile):
299 return 313 return