/// <summary>
        ///
        /// </summary>
        /// <param name="hilos"></param>
        /// <param name="cantidad"></param>
        /// <returns></returns>
        public static LosHilos operator +(LosHilos hilos, int cantidad)
        {
            if (cantidad <= 0)
            {
                throw new CantidadInvalidaException();
            }

            for (int i = 0; i < cantidad; i++)
            {
                LosHilos.AgregarHilo(hilos);
            }
            return(hilos);
        }
Exemplo n.º 2
0
 public static LosHilos operator +(LosHilos hilos, int cantidad)
 {
     if (cantidad < 1)
     {
         throw new CantidadInvalidaException();
     }
     else if (cantidad > 0)
     {
         while (cantidad > 0)
         {
             LosHilos.AgregarHilo(hilos);
             cantidad--;
         }
     }
     return(hilos);
 }
Exemplo n.º 3
0
        public static LosHilos operator +(LosHilos hilos, int cantidad)
        {
            if (!(hilos is null))
            {
                if (cantidad < 1)
                {
                    throw new CantidadInvalidaException();
                }
                else
                {
                    for (int i = 0; i < cantidad; i++)
                    {
                        LosHilos.AgregarHilo(hilos);
                    }
                }
            }

            return(hilos);
        }