Mercurial > libervia-backend
diff frontends/src/quick_frontend/quick_card_game.py @ 587:952322b1d490
Remove trailing whitespaces.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Fri, 18 Jan 2013 17:55:34 +0100 |
parents | ca13633d3b6b |
children | beaf6bec2fcd |
line wrap: on
line diff
--- a/frontends/src/quick_frontend/quick_card_game.py Fri Jan 18 17:55:27 2013 +0100 +++ b/frontends/src/quick_frontend/quick_card_game.py Fri Jan 18 17:55:34 2013 +0100 @@ -25,7 +25,7 @@ class QuickCardGame(): - + def __init__(self, parent, referee, players, player_nick): self._autoplay = None #XXX: use 0 to activate fake play, None else self.parent = parent @@ -58,7 +58,7 @@ self.state = None for pl in self.played: self.played[pl] = None - + def getPlayerLocation(self, nick): """return player location (top,bottom,left or right)""" for location in ['top','left','bottom','right']: @@ -76,7 +76,7 @@ self.cards["coeur"]={} #heart self.cards["carreau"]={} #diamond self.cards["trefle"]={} #club - + def newGame(self, hand): """Start a new game, with given hand""" assert (len(self.hand) == 0) @@ -84,7 +84,7 @@ self.hand.append(self.cards[suit, value]) self.hand.sort() self.state = "init" - + def contratSelected(self, contrat): """Called when the contrat has been choosed @param data: form result""" @@ -94,7 +94,7 @@ """Called when the player as to select his contrat @param xml_data: SàT xml representation of the form""" raise NotImplementedError - + def showCards(self, game_stage, cards, data): """Display cards in the middle of the game (to show for e.g. chien ou poignée)""" self.to_show = [] @@ -111,7 +111,7 @@ self.to_show = [] self.state = "play" self.__fakePlay() - + def __fakePlay(self): """Convenience method for stupid autoplay /!\ don't forgot to comment any interactive dialog for invalid card""" @@ -131,7 +131,7 @@ @param winners: list of winners' nicks @param loosers: list of loosers' nicks""" raise NotImplementedError - + def cardsPlayed(self, player, cards): """A card has been played by player""" if self.to_show: @@ -143,7 +143,7 @@ for suit, value in cards: pl_cards.append(self.cards[suit, value]) self.played[player] = pl_cards[0] - + def invalidCards(self, phase, played_cards, invalid_cards): """Invalid cards have been played @param phase: phase of the game @@ -156,10 +156,10 @@ self.state = "ecart" else: error ('INTERNAL ERROR: unmanaged game phase') - + for suit, value in played_cards: self.hand.append(self.cards[suit, value]) - + self.hand.sort() self.__fakePlay()