예제 #1
0
 public static void AddTeam(Team team)
 {
     if (CheckIfTeamExists(team))
     {
         throw new InvalidOperationException("Team already exists in that league");
     }
 }
예제 #2
0
파일: League.cs 프로젝트: nadiahristova/OOP
        public static void AddTeam(Team team)
        {
            if (CheckIfTeamExists(team))
                throw new InvalidOperationException("Team already exists in this league.");

            teams.Add(team);
        }
예제 #3
0
파일: Match.cs 프로젝트: jechev/OOP
 public Match(int id,Team homeTeam,Team awayTeam,Score score)
 {
     this.Id = id;
     this.HomeTeam = homeTeam;
     this.AwayTeam = awayTeam;
     this.Score = score;
 }
예제 #4
0
 public Match(Team homeTeam, Team awayTeam, Score score)
 {
     this.checkTeams = this.CheckTeams(homeTeam, awayTeam);
     this.HomeTeam = homeTeam;
     this.AwayTeam = awayTeam;
     this.Score = score;
 }
 public static void AddTeam(Team team)
 {
     if (CheckIfTeamExists(team))
     {
         throw new InvalidOperationException("Team already exists");
     }
     teams.Add(team);
 }
예제 #6
0
 public static void AddTeam(Team team)
 {
     if (TeamExists(team))
     {
         throw new InvalidOperationException("This team is already in that league.");
     }
     teams.Add(team);
 }
예제 #7
0
 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;
 }
예제 #8
0
        public static void AddTeam(Team team)
        {
            if (TeamExistInLeague(team))
            {
                throw new InvalidOperationException(MsgConstants.TeamAlreadyExists);
            }

            teams.Add(team);
        }
예제 #9
0
파일: League.cs 프로젝트: jechev/OOP
 public static void AddTeam(Team team)
 {
     var existTeam = teams.FirstOrDefault(m => m.Name == team.Name);
     if (existTeam != null)
     {
         throw new OperationCanceledException("Cannot add Team with the same name.");
     }
     teams.Add(team);
 }
예제 #10
0
        public Match(Team homeTeam, Team awayTeam, Score score, int id)
        {
            if (homeTeam.Name == awayTeam.Name)
            {
                throw new ArgumentException(MsgConstants.TeamsShouldBeDifferent);
            }

            this.HomeTeam = homeTeam;
            this.AwayTeam = awayTeam;
            this.MatchScore = score;
            this.Id = id;
        }
예제 #11
0
파일: Match.cs 프로젝트: jechev/OOP
 public Match(int id,Team homTeam,Team awayTeam)
     : this(id,homTeam,awayTeam,null)
 {
 }
예제 #12
0
 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;
 }
예제 #13
0
파일: League.cs 프로젝트: T316/OOP
 public static bool CheckIfTeamExists(Team team)
 {
     return teams.Any(t => t.Name == team.Name);
 }
예제 #14
0
 private static bool TeamExists(Team team)
 {
     return teams.Any(t => t.Name == team.Name);
 }
 private static bool CheckIfTeamExists(Team team)
 {
     return teams.Any(p => p.Name == team.Name);
 }
예제 #16
0
 private bool CheckTeams(Team homeTeam, Team awayTeam)
 {
     return homeTeam.Name == awayTeam.Name;
 }
 private static void AddTeam(Team newTeam)
 {
     League.AddTeam(newTeam);
     Console.WriteLine("The {0} has been added successfully", newTeam.Name);
 }
예제 #18
0
파일: Match.cs 프로젝트: nadiahristova/OOP
 public Match(Team homeTeam, Team awayTeam)
     : this(homeTeam, awayTeam, null)
 {
 }
예제 #19
0
파일: Match.cs 프로젝트: nadiahristova/OOP
 public Match(Team homeTeam, Team awayTeam, Score score)
 {
     this.HomeTeam = homeTeam;
     this.AwayTeam = awayTeam;
     this.Score = score;
 }