public IceCreamBase Create(int flavourOption, int noOfScoops = 1)
        {
            switch (flavourOption)
            {
            case (int)Flavour.Vanilla:
                _icecream = new Vanilla();
                break;

            case (int)Flavour.Chocolate:
                _icecream = new Chocolate();
                break;

            case (int)Flavour.Strawberry:
                _icecream = new Strawberry();
                break;

            case (int)Flavour.CookiesAndCream:
                _icecream = new CookiesAndCream();
                break;

            case (int)Flavour.Hazelnut:
                _icecream = new Hazelnut();
                break;
            }
            _icecream.NoOfScoops = noOfScoops;
            return(_icecream);
        }
        public IceCreamBase Addon(int toppings, IceCreamBase icecream)
        {
            switch (toppings)
            {
            case (int)Toppings.Chocochips:
                icecream = new Chocochips(icecream);
                break;

            case (int)Toppings.Cookies:
                icecream = new Cookies(icecream);
                break;

            case (int)Toppings.Jelly:
                icecream = new Jelly(icecream);
                break;

            case (int)Toppings.Fruits:
                icecream = new Fruits(icecream);
                break;

            case (int)Toppings.Almonnd:
                icecream = new Almond(icecream);
                break;

            case (int)Toppings.Cashew:
                icecream = new Cashew(icecream);
                break;

            case (int)Toppings.Pistachio:
                icecream = new Pistachio(icecream);
                break;

            default:
                break;
            }

            return(icecream);
        }
Exemple #3
0
 public Jelly(IceCreamBase icecream)
 {
     _icecream = icecream;
 }
Exemple #4
0
 public Chocochips(IceCreamBase icecream)
 {
     _icecream = icecream;
 }
Exemple #5
0
 public Almond(IceCreamBase icecream)
 {
     _icecream = icecream;
 }
 public Cookies(IceCreamBase icecream)
 {
     _icecream = icecream;
 }
 public Pistachio(IceCreamBase icecream)
 {
     _icecream = icecream;
 }
 private static void Print(IceCreamBase iceCream)
 {
     Console.WriteLine("***************************************************");
     Console.WriteLine("-----------Billing---------");
     Console.WriteLine($"{iceCream.Description()} : {iceCream.Cost()} $");
 }
Exemple #9
0
 public Fruits(IceCreamBase icecream)
 {
     _icecream = icecream;
 }
Exemple #10
0
 public Cashew(IceCreamBase icecream)
 {
     _icecream = icecream;
 }