public void AddPlayer(Player player) { if (CheckIfPlayerExist(player)) { throw new InvalidOperationException("Player already exist for that team."); } this.players.Add(player); }
public static void AddPlayerToTeam(Player player) { players.Add(player); }
public bool CheckIfPlayerExist(Player player) { return this.players.Any(ime => ime.FirstName == player.FirstName && ime.LastName == player.LastName); }