예제 #1
0
    def createTeams(self, rosterCount=0):
        """ Creating Team """

        newTeam = Team()
        count = 0

        while count < rosterCount:

            playerData = self.getPlayerInfo()

            if not playerData:
                print("Invalid Entry")
            else:
                newTeam.addPlayer(playerData)
                count += 1

        self.__disconnect__()
        return newTeam
예제 #2
0
파일: main.py 프로젝트: yurokji/pyFM
team_names = [
    "리버풀", "맨시티", "레스터시티", "첼시", "맨유", "울버햄튼", "쉐필드", "아스날", "토트넘", "번리",
    "에버튼", "크리스탈팰리스", "뉴캐슬", "사우스햄튼", "브라이튼", "웨스트햄", "왓포드", "아스톤빌라", "본머스",
    "노르위치시티"
]

numTeams = len(team_names)
teams = []
list_profile = ["호날두", "FW", "포르투갈", 186, 75, 35]

for i in range(numTeams):
    team = Team(team_names[i])
    for j in range(Team.numPlayers):
        p = Player(list_profile)
        team.addPlayer(p)
    teams.append(team)

homeTeam = teams[2]
awayTeam = teams[4]

match_homeTeam = homeTeam.prepMatch()
match_awayTeam = awayTeam.prepMatch()
match_homeTeam.setFormation(442)
match_awayTeam.setFormation(442)
homeTeamPlayers = homeTeam.getMatchObj().getFormationObj().getBestEleven()
awayTeamPlayers = homeTeam.getMatchObj().getFormationObj().getBestEleven()
homeTeamPosition = [player.getPosition() for player in homeTeamPlayers]
awayTeamPosition = [player.getPosition() for player in awayTeamPlayers]
print("homeTeamPosition: ", homeTeamPosition)
print("awayTeamPosition: ", awayTeamPosition)