Example #1
0
    def show_stats(self):
        # Two listviews with players -> player stats
        # would be a rather cool way. 

        # Or a spreadsheet format with players on rows, sortable by a stat.

        # For now: Print all stats to in a dialog.
        # Probably results in horrible things when the player list gets long enough. 
        # TODO: make the message area scrollable, with detailed_text or something else. 
        statsstring = ""
        players = fops.read_players()

        for plr in players:
            statsstring += plr.name + "'s Stats: \n"
            statsstring += str(plr.stats)
        
        d = QMessageBox()
        d.setText(statsstring)
        d.exec_()



    # Game related functions 


        pass
Example #2
0
    def save_players(self):
        old_players = f.read_players()
        new_players = self.players

        for plr in new_players:
            for update_me in old_players:
                if plr.name == update_me.name:
                    update_me.balance = plr.balance
                    update_me.stats = plr.stats
                    break

        f.save_players(old_players)
Example #3
0
def options():
    action = ui.options()
    if (action == 'r'):
        print r.Rules()
    elif (action == 's'):
        players = f.read_players()

        for plr in players:
            print "Stats for", plr
            plr.stats.print_stats()
    else:  
        pass
Example #4
0
    def save_players(self):
        old_players = f.read_players()
        new_players = self.players

        for plr in new_players:
            for update_me in old_players:
                if plr.name == update_me.name:
                    update_me.balance = plr.balance
                    update_me.stats = plr.stats
                    break

        f.save_players(old_players)
Example #5
0
def options():
    action = ui.options()
    if (action == 'r'):
        print r.Rules()
    elif (action == 's'):
        players = f.read_players()

        for plr in players:
            print "Stats for", plr
            plr.stats.print_stats()
    else:
        pass
Example #6
0
    def create_players(self):

        players = f.read_players()

        if self.GUI:
            selected = gui.get_players_for_game(players)
        else:
            selected = ui.get_players_for_game(players)

    #    pdb.set_trace()

    # Check here if we have enough cards in play.
    # For now just quit if more than 4 players D:

        print "got over plr seleciton."
        print "selected ", selected[0]

        #       pdb.set_trace()

        for sel in selected:
            self.players.append(sel)
Example #7
0
    def create_players(self):


        players = f.read_players()

        if self.GUI:
            selected = gui.get_players_for_game(players)
        else: 
            selected = ui.get_players_for_game(players)

    #    pdb.set_trace()

        # Check here if we have enough cards in play. 
        # For now just quit if more than 4 players D:

        print "got over plr seleciton."
        print "selected ", selected[0]

 #       pdb.set_trace()

        for sel in selected:
            self.players.append(sel)