comparison frontends/wix/card_game.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 1eb5ccead43c
children 01d7bd6f0e86
comparison
equal deleted inserted replaced
94:1eb5ccead43c 95:be206a3d1a9b
172 def MyTurn(self): 172 def MyTurn(self):
173 """Called when we have to play :)""" 173 """Called when we have to play :)"""
174 if self.state == "chien": 174 if self.state == "chien":
175 self.to_show = [] 175 self.to_show = []
176 self.state = "play" 176 self.state = "play"
177
178 #tmp gof: FIXME
179 card = self.hand[-1]
180 self.parent.host.bridge.tarotGamePlayCards(self.player_nick, self.referee, [(card.suit, card.value)], profile_key = self.parent.host.profile)
181 del self.hand[-1]
182 self.state = "wait"
183 self._recalc_ori()
184 self.Refresh()
177 185
186 def showScores(self, xml_data, winners, loosers):
187 """Called when the player as to select hist contrat
188 @param xml_data: SàT xml representation of the form"""
189 form = Form(self.parent.host, xml_data, title = _('You win \o/') if self.player_nick in winners else _('You loose :('), options = ['NO_CANCEL'])
190
178 def cardsPlayed(self, player, cards): 191 def cardsPlayed(self, player, cards):
179 """A card has been played by player""" 192 """A card has been played by player"""
180 if self.to_show: 193 if self.to_show:
181 self.to_show = [] 194 self.to_show = []
182 pl_cards = [] 195 pl_cards = []