Beispiel #1
0
    def from_dict(self, dict_in):
        players_arr = dict_in["players"]
        for player in players_arr:
            player_obj = Player.from_dict(player)
            self.players[player_obj.player_id] = player_obj

        for match in dict_in["matches"]:
            self.matches.append(Match.from_dict(match))

        self.league_title = dict_in["league_title"]

        self.recalculate_rankings()
Beispiel #2
0
    def from_dict(self, dict_in):
        players_arr = dict_in["players"]
        for player in players_arr:
            player_obj = Player.from_dict(player)
            self.players[player_obj.player_id] = player_obj
            if self.__use_true_skill is True:
                from trueskill import Rating
                player_obj.true_skill = Rating()

        for match in dict_in["matches"]:
            self.matches.append(Match.from_dict(match))

        self.recalculate_rankings()