public static Cantina GetCantina(int espacios)
 {
     if (Cantina.singleton is null)
     {
         singleton = new Cantina(espacios);
     }
     Cantina.singleton.espaciosTotales = espacios;
     return(Cantina.singleton);
 }
Beispiel #2
0
 public static Cantina GetCantina(int espacios)
 {
     if (singleton is null)
     {
         singleton = new Cantina(espacios);
     }
     else
     {
         singleton.espaciosTotales = espacios;
     }
     return(singleton);
 }
 public static Cantina GetCantina(int espacio)
 {
     if (Cantina.singleton is null)
     {
         Cantina.singleton = new Cantina(espacio);
     }
     else
     {
         Cantina.singleton.espaciosTotales = espacio;
     }
     return(Cantina.singleton);
 }
Beispiel #4
0
        public static Cantina GetCantina(int espacios)
        {
            if (singleton == null)
            {
                singleton = new Cantina(espacios);
            }

            if (singleton != null)
            {
                espaciosTotales = espacios;
            }

            return(singleton);
        }
Beispiel #5
0
 public static Cantina GetCantina(int espacios)
 {
     if (Cantina.singleton == null)
     {
         return(Cantina.singleton = new Cantina(espacios));
     }
     else
     {
         List <Botella> botellas = Cantina.singleton.Botellas;
         Cantina        c1       = new Cantina(espacios);
         foreach (Botella b in botellas)
         {
             if (!(c1 + b))
             {
                 break;
             }
         }
         return(c1);
     }
 }