Exemplo n.º 1
0
        public void deleteAllFromOrder(Sushi sushi)
        {
            int c = sushis.Count(s => s.Name == sushi.Name);

            TotalPrice -= c * sushi.Price;
            sushis.RemoveAll(v => v.Name == sushi.Name);
        }
Exemplo n.º 2
0
        public void deleteFromOrder(Sushi sushi)
        {
            int index = sushis.FindIndex(v => v.Name == sushi.Name);

            if (index != -1)
            {
                sushis.RemoveAt(index);
                TotalPrice -= sushi.Price;
            }
        }
Exemplo n.º 3
0
 public void addToOrder(Sushi sushi)
 {
     sushis.Add(sushi);
     TotalPrice += sushi.Price;
 }