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);
        }
示例#3
0
 public Jelly(IceCreamBase icecream)
 {
     _icecream = icecream;
 }
示例#4
0
 public Chocochips(IceCreamBase icecream)
 {
     _icecream = icecream;
 }
示例#5
0
 public Almond(IceCreamBase icecream)
 {
     _icecream = icecream;
 }
示例#6
0
 public Cookies(IceCreamBase icecream)
 {
     _icecream = icecream;
 }
示例#7
0
 public Pistachio(IceCreamBase icecream)
 {
     _icecream = icecream;
 }
示例#8
0
 private static void Print(IceCreamBase iceCream)
 {
     Console.WriteLine("***************************************************");
     Console.WriteLine("-----------Billing---------");
     Console.WriteLine($"{iceCream.Description()} : {iceCream.Cost()} $");
 }
示例#9
0
 public Fruits(IceCreamBase icecream)
 {
     _icecream = icecream;
 }
示例#10
0
 public Cashew(IceCreamBase icecream)
 {
     _icecream = icecream;
 }