コード例 #1
0
def deserialized_player(i):
    """ This function set back the data about players to instance to the
    class Player """
    player = Player(i['first_name'], i['last_name'], i['birthday'],
                    i['gender'], i['rank'], i['score_of_round'],
                    i['final_score_of_tournament'])
    player.scores = i["scores"]
    player.final_score = i['final_score']
    return player
コード例 #2
0
ファイル: tournaments.py プロジェクト: MargueriteT/P4_v4
    def players_of_the_tournament(self):
        """This function add instance of a player to the list of tournament"""
        i = Player(first_name=PlayerForms.first_name,
                   last_name=PlayerForms.last_name,
                   birthday=PlayerForms.birth_date,
                   gender=PlayerForms.gender,
                   rank=PlayerForms.rank,
                   score_of_round=0,
                   final_score_of_tournament=0)

        self.list_of_players.append(i)
        i.scores = {self.name: {}}
        return i
コード例 #3
0
ファイル: tournaments.py プロジェクト: MargueriteT/P4_v5
    def players_of_the_tournament(self):
        """This function add instance of a player to the list of tournament"""
        i = Player(first_name=input("first_name"),
                   last_name=input("last_name"),
                   birthday=datetime.datetime(year=int(
                            input("year")), month=int(
                            input("month")), day= int(
                            input("year"))),
                   gender=input("gender"),
                   rank=input("rank"),
                   score_of_round=0,
                   final_score_of_tournament=0)

        self.list_of_players.append(i)
        i.scores = {self.name: {}}
        return i