Пример #1
0
 public void QuitarParticipante(SeleccionFutbol f)// "f"===>HIJAS
 {
     if (BajaSeleccion(f, f.GetId()))
     {
         if (f.GetType().Name == "Entrenador")
         {
             numeroEntrenadores--;
         }
         else if (f.GetType().Name == "Masajista")
         {
             numeroMasajistas--;
         }
         Console.WriteLine("Participante tipo " + f.GetType().Name + " suprimido.");
         participante.Remove(f);
     }
 }
Пример #2
0
 public void AñadirParticipante(SeleccionFutbol f)
 {
     if (AltaSeleccion(f))
     {
         if (f.GetType().Name == "Entrenador")
         {
             numeroEntrenadores++;
         }
         else if (f.GetType().Name == "Masajista")
         {
             numeroMasajistas++;
         }
         Console.WriteLine("Participante tipo " + f.GetType().Name + " añadido.");
         participante.Add(f);
     }
 }
Пример #3
0
 public bool AltaSeleccion(SeleccionFutbol f)
 {
     if (participante.Count < 31)
     {
         if (f.GetType().Name == "Masajista" && numeroMasajistas < 5)
         {
             return(true);
         }
         else if (f.GetType().Name == "Entrenador" && numeroEntrenadores < 3)
         {
             return(true);
         }
         else if (f.GetType().Name == "Futbolista")
         {
             return(true);
         }
         Console.WriteLine("No caben más " + f.GetType().Name + "En la lista");
         Console.ReadLine();
         return(false);
     }
     Console.WriteLine("No caben más " + f.GetType().Name + "en la lista");
     Console.ReadLine();
     return(false);
 }