public Match(Team homeTeam, Team awayTeam, Score score, int id)
 {
     this.homeTeam = homeTeam;
     this.awayTeam = awayTeam;
     this.score = score;
     this.id = id;
 }
Exemple #2
0
 public static void AddTeam(Team team)
 {
     if (CheckTeamsExists(team))
     {
         teams.Add(team);
     }
 }
Exemple #3
0
 public Match(Team homeTeam, Team awayTeam, Scores score, int id)
 {
     this.HomeTeam = homeTeam;
     this.AwayTeam = awayTeam;
     this.score = score;
     this.Id = id;
 }
Exemple #4
0
 public static void AddMatch(int id, Team homeTeam, Team awayTeam, Score score)
 {
     if (!matchExists(id))
     {
         Matches.Add(new Match(id, homeTeam, awayTeam, score));
     }
 }
Exemple #5
0
 public Players(string firstName, string lastName, DateTime dateOfBird, decimal salary, Team team)
 {
     this.FirstName = firstName;
     this.LastName = lastName;
     this.DateOfBird = dateOfBird;
     this.Salary = salary;
     this.Team = team;
 }
Exemple #6
0
 public static void AddTeam(Team team)
 {
     if (TeamAddCheck(team))
     {
         throw new InvalidOperationException("Team already exists in the league!");
     }
     Teams.Add(team);
 }
Exemple #7
0
 public static void AddTeams(Team team)
 {
     if (AddTeamsChecker(team))
     {
         throw new InvalidOperationException("Team already exists in the league.");
     }
     teams.Add(team);
 }
Exemple #8
0
 public Player(string firstName, string lastName, decimal salary, DateTime birthday, Team team)
 {
     this.FirstName = firstName;
     this.LastName = lastName;
     this.Salary = salary;
     this.BirthDay = birthday;
     this.Team = team;
 }
Exemple #9
0
        private static bool CheckTeamsExists(Team team)
        {
            if (teams.Any(t => t.Name == team.Name))
            {
                return false;
            }

            return true;
        }
 private static void AddTeam(string name, string nickname, DateTime dateOfFounding)
 {
     Team team = new Team(name, nickname, dateOfFounding);
     if (League.CheckIfTeamExist(team))
     {
         throw new InvalidOperationException("This team already exist");
     }
     League.AddTeam(team);
     Console.WriteLine("Team - Confirmed");
 }
 private static void AddPlayerToTeam(string firstName, string lastName, DateTime dateOfBirth, decimal salary, string team)
 {
     Team t = new Team(firstName, "       ", new DateTime(1850, 1, 1));
     t.Name = team;
     Player player = new Player(firstName, lastName, salary, dateOfBirth, t);
     if (t.CheckIfPlayerExist(player))
     {
         throw new InvalidOperationException("Player exist in this team");
     }
     t.AddPlayer(player);
     Console.WriteLine("Player - Confirmed");
 }
 private static void AddMatch(int id, string homeTeamName, string awayTeamName, string score)
 {
     Team t = new Team(homeTeamName, "     ", new DateTime(1850, 1, 1));
     t.Name = homeTeamName;
     Team s = new Team(awayTeamName, "        ", new DateTime(1850, 1, 1));
     s.Name = awayTeamName;
     Score sc;
     string[] scc = score.Split(' ');
     sc = new Score(int.Parse(scc[0]), int.Parse(scc[1]));
     Match match = new Match(t, s, sc, id);
     if (League.CheckIfMatchExist(match))
     {
         throw new InvalidOperationException("This match already exist");
     }
     League.AddMatch(match);
     Console.WriteLine("Match - Confirmed");
 }
Exemple #13
0
 private static bool TeamAddCheck(Team team)
 {
     return Teams.Any(t => t.Name == team.Name);
 }
Exemple #14
0
 private static void AddTeam(Team newTeam)
 {
     League.AddTeam(newTeam);
     Console.WriteLine("The " + newTeam.Name + " team has been added succesfully");
 }
Exemple #15
0
 public static bool AddTeamsChecker(Team team)
 {
     return Teams.Any(t => t.Name == team.Name);
 }