comparison frontends/src/primitivus/card_game.py @ 328:809733b8d9be

Tarot game: - draw game managed - we can now play continuously \o/
author Goffi <goffi@goffi.org>
date Mon, 23 May 2011 00:46:51 +0200
parents 7bc1b3401ecb
children cf005701624b
comparison
equal deleted inserted replaced
327:7c9784658163 328:809733b8d9be
272 QuickCardGame.myTurn(self) 272 QuickCardGame.myTurn(self)
273 273
274 def showScores(self, xml_data, winners, loosers): 274 def showScores(self, xml_data, winners, loosers):
275 """Called when the player as to select hist contrat 275 """Called when the player as to select hist contrat
276 @param xml_data: SàT xml representation of the form""" 276 @param xml_data: SàT xml representation of the form"""
277 form = XMLUI(self.parent.host, xml_data, title = _('You win \o/') if self.player_nick in winners else _('You loose :('), options = ['NO_CANCEL']) 277 def _new_game(ignore):
278 self.resetRound()
279 for location in ['top','left','bottom','right']:
280 self.table.putCard(location, None)
281 self.parent.host.redraw()
282 self.parent.host.bridge.tarotGameReady(self.player_nick, self.referee, profile_key = self.parent.host.profile)
283 if not winners and not loosers:
284 title = _("Draw game")
285 else:
286 title = _('You win \o/') if self.player_nick in winners else _('You loose :(')
287 form = XMLUI(self.parent.host, xml_data, title = title, options = ['NO_CANCEL'], misc={'callback':_new_game})
278 form.show() 288 form.show()
279 289
280 def invalidCards(self, phase, played_cards, invalid_cards): 290 def invalidCards(self, phase, played_cards, invalid_cards):
281 """Invalid cards have been played 291 """Invalid cards have been played
282 @param phase: phase of the game 292 @param phase: phase of the game