Пример #1
0
 public static void Spausdinti(IceCreamMaker ledai)
 {
     Console.WriteLine("Ingridientai:" + ledai.GetDescription());
     Console.WriteLine("Kaina:" + ledai.GetCost());
     Console.WriteLine("Kaušelių skaičius:" + ledai.getScoopCount());
     Console.WriteLine("--------------------------------------------");
 }
Пример #2
0
        public IceCreamMaker RemoveRole <T>()
        {
            if (this is T)
            {
                return(this);
            }

            if (DecoratedIceCream is T)
            {
                DecoratedIceCream = ((ToppingDecorator)DecoratedIceCream).DecoratedIceCream;
                return(this);
            }

            if (DecoratedIceCream is ToppingDecorator)
            {
                return(((ToppingDecorator)DecoratedIceCream).RemoveRole <T>());
            }

            return(this);
        }
Пример #3
0
 protected ToppingDecorator(IceCreamMaker newIceCream)
 {
     DecoratedIceCream = newIceCream;
 }
Пример #4
0
 public VanillaIceCream(IceCreamMaker newICeCream) : base(newICeCream)
 {
     addScoop();
 }
Пример #5
0
 public ChocolateIceCream(IceCreamMaker newICeCream) : base(newICeCream)
 {
     addScoop();
 }
Пример #6
0
 public StrawberryIceCream(IceCreamMaker newICeCream) : base(newICeCream)
 {
     addScoop();
 }