Mercurial > libervia-backend
diff frontends/quick_frontend/quick_app.py @ 95:be206a3d1a9b
Tarot game: score calculation
- plugin tarot: score validity is now checked (some of attackers and defender must equal 91)
- plugin tarot: new signal tarotGameScore to give the scores and winners/loosers
- wix: score are now displayed at the end of the game
- xml_tools: 'fixed' type is now managed in dataForm2xml
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 02 Jun 2010 15:57:23 +0930 |
parents | 2f87651a5ad8 |
children | 63c9067a1499 |
line wrap: on
line diff
--- a/frontends/quick_frontend/quick_app.py Tue Jun 01 18:16:15 2010 +0930 +++ b/frontends/quick_frontend/quick_app.py Wed Jun 02 15:57:23 2010 +0930 @@ -53,6 +53,7 @@ self.bridge.register("tarotGameChooseContrat", self.tarotChooseContrat) self.bridge.register("tarotGameShowCards", self.tarotShowCards) self.bridge.register("tarotGameYourTurn", self.tarotMyTurn) + self.bridge.register("tarotGameScore", self.tarotScore) self.bridge.register("tarotGameCardsPlayed", self.tarotCardsPlayed) self.bridge.register("subscribe", self.subscribe) self.bridge.register("paramUpdate", self.paramUpdate) @@ -308,6 +309,14 @@ if self.chat_wins.has_key(room_jid): self.chat_wins[room_jid].getGame("Tarot").MyTurn() + def tarotScore(self, room_jid, xml_data, winners, loosers, profile): + """Called when the game is finished and the score are updated""" + if not self.__check_profile(profile): + return + debug (_("Tarot: score received")) + if self.chat_wins.has_key(room_jid): + self.chat_wins[room_jid].getGame("Tarot").showScores(xml_data, winners, loosers) + def tarotCardsPlayed(self, room_jid, player, cards, profile): if not self.__check_profile(profile): return