Ejemplo n.º 1
0
        public void AddProduct(ContainableItem product)
        {
            ContainableItem[] auxiliaryList = productList;
            productList = new ContainableItem[size + 1];

            for (int i = 0; i < auxiliaryList.Length; i++)
            {
                productList[i] = auxiliaryList[i];
            }

            productList[size] = product;
            size++;
        }
Ejemplo n.º 2
0
 public void Remove(ContainableItem product)
 {
     for (int i = 0; i < productList.Length; i++)
     {
         if (productList[i] == product)
         {
             for (int j = i; j < productList.Length - 1; j++)
             {
                 productList[j] = productList[j + 1];
             }
         }
     }
     size--;
 }