Esempio n. 1
0
 public HotChocolateDeluxeWrapper(HotChocolate choco)
 {
     _hotChocolate = choco;
     _hotChocolate.MakeDeluxe();
     Name      = choco.GetNameOfDrink();
     BasePrice = 1.20;
 }
Esempio n. 2
0
 public ChocolateAdapter(IDrink drink) : base(drink)
 {
     chocolate = new HotChocolate();
     Price     = chocolate.Cost();
     Name      = chocolate.GetNameOfDrink();
     //deluxe is just as expensive as regular?
 }
Esempio n. 3
0
        public HotChocolateAdapter(bool isDeluxe)
        {
            _adaptee = new HotChocolate();

            if (isDeluxe)
            {
                _adaptee.MakeDeluxe();
            }

            Name = _adaptee.GetNameOfDrink();
        }
Esempio n. 4
0
        public ChocolateDrinkDecorator(IDrink drink, bool isDeluxe) : base(drink)
        {
            hotChocolate = new HotChocolate();

            if (isDeluxe)
            {
                hotChocolate.MakeDeluxe();
            }

            this.Name  = hotChocolate.GetNameOfDrink();
            this.Price = hotChocolate.Cost();
        }
Esempio n. 5
0
 protected string GetName()
 {
     return(chocolate.GetNameOfDrink());
 }
Esempio n. 6
0
 public HotChocolateWrapper(HotChocolate choco)
 {
     _hotChocolate = choco;
     Name          = choco.GetNameOfDrink();
     BasePrice     = 1.20;
 }