예제 #1
0
def add_player_to_team():
    if len(free_players) < 1 or len(teams) < 1:
        Console.print("Not enough players or teams generated")
    else:
        show_free_players()
        player = Utils.choose_one_from_list(free_players)
        show_teams()
        team = Utils.choose_one_from_list(teams)
        team.add_player(player)
        free_players.remove(player)
예제 #2
0
def show_teams():
    if len(teams) > 0:
        print("Team List:")
        for i, team in enumerate(teams):
            print("{}. {} ({})".format(i + 1, team.name, team.nationality))
        team = Utils.choose_one_from_list(teams)
        print(team)
        print("Players:")
        for player in team.players:
            print("{}".format(player))
    else:
        Console.print("No teams available", "r")