Beispiel #1
0
        public void AddPizzaConfigurations(PizzaOrder pizzaOrder)
        {
            bool addPrap = false;

            for (int i = 0; i < pizzaOrderCount.Count; i++)
            {
                if (!addPrap & pizzaOrderCount[i].toppings.Length == pizzaOrder.toppings.Length)
                {
                    bool iPrap = true;
                    foreach (string iToppings in pizzaOrder.toppings)
                    {
                        if (Array.IndexOf(pizzaOrderCount[i].toppings, iToppings) == -1)
                        {
                            iPrap = false;
                        }
                    }
                    if (iPrap)
                    {
                        pizzaOrderCount[i].count++;
                        addPrap = true;
                    }
                }
            }
            if (!addPrap)
            {
                this.pizzaOrderCount.Add(new PizzaOrderCount(pizzaOrder));
            }
        }
Beispiel #2
0
 public PizzaOrderCount(PizzaOrder pizzaOrder)
 {
     this.toppings = pizzaOrder.toppings;
     this.count    = 1;
 }