Example #1
0
 def __init__(self, window):
     GamePage.__init__(self, window)
     self.game_id = None
     self.is_player2 = False
     self.is_my_turn = None
     self.createWidgets(window)
     self.connectAsync("awale_played", self.onPlayed)
     self.connectAsync("awale_collected", self.onCollected)
Example #2
0
 def init(self, game_id):
     GamePage.init(self, game_id)
     game = self.client.getGame(game_id, use_cache=False)
     if game["state"] != "playing":
         raise UnicodeException(tr("Game aborted."))
     self.is_player2 = game["players"][0] != self.player_id
     self.is_my_turn = game["next_turn"] == self.player_id
     self.fillTurn()
     self.fillHomes()
Example #3
0
 def init(self, game_id):
     GamePage.init(self, game_id)
     game = self.client.getGame(game_id, use_cache=False)
     self.hand = self.client.command(u'mille_bornes_hand', self.game_id, self.player_id)
     for card_index in xrange(6):
         self.fillCard(card_index)
     self.next_turn = 0
     player_index = game['players'].index(self.player_id)
     self.my_view = self.player_views[player_index]
     self.my_view.is_my_view = True
     for index, view in enumerate(self.player_views):
         view.setActive(index == 0)
Example #4
0
 def __init__(self, window):
     GamePage.__init__(self, window)
     self.createWidgets(window)
     self.connectAsync(u'mille_bornes_play', self.onPlay)
     self.connectAsync(u'game_turn', self.onTurn)