private static void AddTeam(string team, string nickname, DateTime dateOfFoundation)
        {
            var newTeam = new Teams(team, nickname, dateOfFoundation);
            League.AddTeams(newTeam);

            Console.WriteLine($"Team {newTeam.Name} added to League");
        }
Exemple #2
0
 public static void AddTeams(Teams team)
 {
     if (CheckIfTeamExists(team))
     {
         throw new ArgumentException("League already have a team with this name");
     }
     teams.Add(team);
 }
Exemple #3
0
 public Players(string firstName, string lastName, DateTime dateofbirth, decimal salary,
    Teams team)
 {
     this.FirstName = firstName;
        this.LastName = lastName;
        this.DateOfBirth = dateofbirth;
        this.Salary = salary;
        this.Team = team;
 }
Exemple #4
0
 public Matches(int id,Teams homeTeam, Teams awayTeam, Scores scores )
 {
     if (homeTeam.Name == awayTeam.Name)
     {
         throw new ArgumentException("Home and away team must be different");
     }
     this.HomeTeam = homeTeam;
     this.AwayTeam = awayTeam;
     this.Scores = scores;
     this.ID = id;
 }
Exemple #5
0
 private static bool CheckIfTeamExists(Teams team)
 {
     return teams.Any(p => p.Name == team.Name);
 }