示例#1
0
        public Snack(SnacksType snacksType)
        {
            switch (snacksType)
            {
            case SnacksType.Chips:
            {
                this.Name  = "Chips     ";
                this.Price = 2;
            }
            break;

            case SnacksType.Snickers:
            {
                this.Name  = "Snickers  ";
                this.Price = 1;
            }
            break;

            case SnacksType.Bounty:
            {
                this.Name  = "Bounty    ";
                this.Price = 3;
            }
            break;

            case SnacksType.Kexchoklad:
            {
                this.Name  = "Kexchoklad";
                this.Price = 5;
            }
            break;

            case SnacksType.Bilar:
            {
                this.Name  = "Bilar     ";
                this.Price = 2;
            }
            break;
            }
        }
示例#2
0
 public void AddSnackToTempCart(SnacksType snacks)
 {
     TemporaryCart.Add(new Snack(snacks));
 }
示例#3
0
 public void BuySnacks(SnacksType snacks)
 {
     ShoppingCart.Add(new Snack(snacks));
 }