Exemple #1
0
 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);
 }
Exemple #3
0
 public bool CheckIfPlayerExist(Player player)
 {
     return this.players.Any(ime => ime.FirstName == player.FirstName &&
                                  ime.LastName == player.LastName);
 }