Example #1
0
        private int GetIndice(Cocina c)
        {
            int indice  = 0;
            int retorno = -1;

            foreach (Cocina cocina in this._lista)
            {
                if (cocina == c)
                {
                    retorno = indice;
                    break;
                }
                indice++;
            }

            return(retorno);
        }
Example #2
0
        static void Main(string[] args)
        {
            Cocina            c1 = new Cocina(111, 12300, false);
            Cocina            c2 = new Cocina(112, 15000, true);
            Cocina            c3 = new Cocina(113, 5600, false);
            DepositoDeCocinas dc = new DepositoDeCocinas(5);

            dc.Agregar(c1);
            dc.Agregar(c2);
            if (!(dc + c3))
            {
                Console.WriteLine("No se pudo agregar el item!!!\n");
            }
            Console.WriteLine(dc);
            dc.Remover(c2);
            if (!(dc - c2))
            {
                Console.WriteLine("No se pudo remover el item!!!\n");
            }
            Console.WriteLine(dc);
            Console.ReadLine();
        }
Example #3
0
 public bool Remover(Cocina c)
 {
     return(this - c);
 }
Example #4
0
 public bool Agregar(Cocina c)
 {
     return(this + c);
 }