Esempio n. 1
0
 def resume(self,idMatch):
     engine = GameEngineFactory.createMatch(self.game)
     if engine and engine.resume(idMatch): return engine
     return None
Esempio n. 2
0
    def retrievePlayers(self):
        players = list()
        for i in range(self.rowCount()):
            nick = str(self.item(i).text())
            players.append(nick)
        return players

    def itemFromPlayer(self, player):
        for i in range(self.rowCount()):
            item = self.item(i)
            nick = str(item.text())
            if nick == player:
                return item
        return None


if __name__ == "__main__":
    import sys
    from controllers.db import db
    from controllers.enginefactory import GameEngineFactory
    db.connectDB()
    app = QApplication(sys.argv)
    engine = GameEngineFactory.createMatch('Pocha')
    players = ['Xavi', 'Rosa', 'Dani']
    for p in players:
        engine.addPlayer(p)
    engine.begin()
    mw = PlayerOrderDialog(engine)
    mw.show()
    sys.exit(app.exec_())