Exemplo n.º 1
0
 def run_rounds(self, amount):
     for event in range(amount):
         self.perform_actions()
         if not event % 10:
             for p in event_handler.get_all_players():
                 self.calculate_et_skills(p["id"])
     for p in event_handler.get_all_players():
         self.calculate_llt_skills(p["id"])
Exemplo n.º 2
0
 def load_players(self, max_amount):
     players = event_handler.get_all_players()[:max_amount]
     # assign each player to a team
     self.players = []
     # create teams
     self.create_teams()
     for i, p in enumerate(players):
         # assign player round robbin
         team = self.teams.keys()[i % len(self.teams.keys())]
         # give player a strength and weakness
         strength = self.ACTIONS[i % len(players)]
         weakness = self.ACTIONS[-(i+1) % len(players)]
         player = self.wd.load_player(p["id"])
         self.wd.add_player_to_team(player, team)
         self.players.append({
             "player": player,
             "team": team,
             "strength": strength,
             "weakness": weakness,
             "location": None,
         })
         print(player.name, strength, weakness)
         self.teams[team].append(p)