예제 #1
0
파일: Match.cs 프로젝트: krasi070/OOP
 public Match(Team homeTeam, Team awayTeam, Score score, int id)
 {
     this.HomeTeam = homeTeam;
     this.AwayTeam = awayTeam;
     this.Score = score;
     this.ID = id;
 }
예제 #2
0
파일: Player.cs 프로젝트: krasi070/OOP
 public Player(string firstName, string lastName, decimal salary, DateTime dateOfBirth, Team team)
 {
     this.FirstName = firstName;
     this.LastName = lastName;
     this.Salary = salary;
     this.DateOfBirth = dateOfBirth;
     this.Team = team;
 }
예제 #3
0
파일: League.cs 프로젝트: krasi070/OOP
        public static void AddTeam(Team team)
        {
            if (CheckIfTeamExists(team))
            {
                throw new InvalidOperationException("This team is already in this league");
            }

            teams.Add(team);
        }
예제 #4
0
파일: League.cs 프로젝트: krasi070/OOP
 private static bool CheckIfTeamExists(Team team)
 {
     return teams.Any(t => t.Name == team.Name);
 }