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
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
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