public Match(Team homeTeam, Team awayTeam, Score score, int id)
 {
     this.homeTeam = homeTeam;
     this.awayTeam = awayTeam;
     this.score = score;
     this.id = id;
 }
Example #2
0
 public static void AddTeam(Team team)
 {
     if (CheckTeamsExists(team))
     {
         teams.Add(team);
     }
 }
Example #3
0
 public Match(Team homeTeam, Team awayTeam, Scores score, int id)
 {
     this.HomeTeam = homeTeam;
     this.AwayTeam = awayTeam;
     this.score = score;
     this.Id = id;
 }
Example #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));
     }
 }
Example #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;
 }
Example #6
0
File: League.cs Project: Gab42/OOP
 public static void AddTeam(Team team)
 {
     if (TeamAddCheck(team))
     {
         throw new InvalidOperationException("Team already exists in the league!");
     }
     Teams.Add(team);
 }
Example #7
0
 public static void AddTeams(Team team)
 {
     if (AddTeamsChecker(team))
     {
         throw new InvalidOperationException("Team already exists in the league.");
     }
     teams.Add(team);
 }
Example #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;
 }
Example #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");
 }
Example #13
0
File: League.cs Project: Gab42/OOP
 private static bool TeamAddCheck(Team team)
 {
     return Teams.Any(t => t.Name == team.Name);
 }
Example #14
0
 private static void AddTeam(Team newTeam)
 {
     League.AddTeam(newTeam);
     Console.WriteLine("The " + newTeam.Name + " team has been added succesfully");
 }
Example #15
0
 public static bool AddTeamsChecker(Team team)
 {
     return Teams.Any(t => t.Name == team.Name);
 }