Example #1
0
 public Match(int id, Team homeTeam, Team awayTeam, Score score)
 {
     this.ID = id;
     this.HomeTeam = homeTeam;
     this.AwayTeam = awayTeam;
     this.Score = score;
 }
Example #2
0
        private static void AddTeam(string teamName, string teamNickName, DateTime teamFoundationDate)
        {
            Team currentTeam = new Team(teamName, teamNickName, teamFoundationDate);

            League.AddTeam(currentTeam);

            Console.WriteLine("Team successfully added!");
        }
Example #3
0
        public static void AddTeam(Team currentTeam)
        {
            if (TeamExists(currentTeam))
            {
                throw new InvalidOperationException("Team already exists in the league!");
            }

            teams.Add(currentTeam);
        }
Example #4
0
 private static bool TeamExists(Team currentTeam)
 {
     bool teamExists = Teams.Any(x => x.Name.Equals(currentTeam.Name));
     return teamExists;
 }