public Match(Team homeTeam, Team awayTeam, Score score, int id) { this.homeTeam = homeTeam; this.awayTeam = awayTeam; this.score = score; this.id = id; }
public static void AddTeam(Team team) { if (CheckTeamsExists(team)) { teams.Add(team); } }
public Match(Team homeTeam, Team awayTeam, Scores score, int id) { this.HomeTeam = homeTeam; this.AwayTeam = awayTeam; this.score = score; this.Id = id; }
public static void AddMatch(int id, Team homeTeam, Team awayTeam, Score score) { if (!matchExists(id)) { Matches.Add(new Match(id, homeTeam, awayTeam, score)); } }
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; }
public static void AddTeam(Team team) { if (TeamAddCheck(team)) { throw new InvalidOperationException("Team already exists in the league!"); } Teams.Add(team); }
public static void AddTeams(Team team) { if (AddTeamsChecker(team)) { throw new InvalidOperationException("Team already exists in the league."); } teams.Add(team); }
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; }
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"); }
private static bool TeamAddCheck(Team team) { return Teams.Any(t => t.Name == team.Name); }
private static void AddTeam(Team newTeam) { League.AddTeam(newTeam); Console.WriteLine("The " + newTeam.Name + " team has been added succesfully"); }
public static bool AddTeamsChecker(Team team) { return Teams.Any(t => t.Name == team.Name); }