Mercurial > libervia-backend
diff frontends/wix/card_game.py @ 90:4020931569b8
Tarot Game: session initialization
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 23 May 2010 16:39:05 +0930 |
parents | 66d784082930 |
children | 39c672544593 |
line wrap: on
line diff
--- a/frontends/wix/card_game.py Thu May 13 16:27:48 2010 +0930 +++ b/frontends/wix/card_game.py Sun May 23 16:39:05 2010 +0930 @@ -83,8 +83,10 @@ class CardPanel(wx.Panel): """This class is used to display the cards""" - def __init__(self, parent, players, user): + def __init__(self, parent, referee, players, user): wx.Panel.__init__(self, parent) + self.parent = parent + self.referee = referee self.players = players self.user = user self.bottom_nick = self.user @@ -107,6 +109,7 @@ self.Bind(wx.EVT_PAINT, self.onPaint) self.Bind(wx.EVT_MOTION, self.onMouseMove) self.Bind(wx.EVT_LEFT_UP, self.onMouseClick) + self.parent.host.bridge.tarotGameReady(user, referee, profile_key = self.parent.host.profile) def load_cards(self, dir): """Load all the cards in memory @@ -130,6 +133,7 @@ def newGame(self, hand): """Start a new game, with given hand""" + print "gof: new game ici avec",hand assert (len(self.hand) == 0) for family, value in hand: self.hand.append(self.cards[family, value]) @@ -198,21 +202,3 @@ del self.hand[idx] self._recalc_ori() self.Refresh() - -class CardGame(wx.Frame, QuickChat): - """The window used to play all kind of card games""" - - def __init__(self, host): - wx.Frame.__init__(self, None, pos=(0,0), size=(950,500)) - - self.host = host - - self.sizer = wx.BoxSizer(wx.VERTICAL) - self.panel = CardPanel(self) - self.sizer.Add(self.panel, 1, flag=wx.EXPAND) - self.SetSizer(self.sizer) - self.SetAutoLayout(True) - - - #events -