Beispiel #1
0
        static void Main(string[] args)
        {
            IceCream iceCream = new Chocolate();

            iceCream = new Sprinkle(iceCream);
            iceCream = new Fudge(iceCream);
            iceCream = new Blueberries(iceCream);

            Console.WriteLine(iceCream.Cost());

            Console.ReadLine();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            var client = new Client();

            var expresso = new Expresso();

            //Only Expresso
            client.ClientCode(expresso);
            Console.WriteLine();
            //Expresso with caramel
            var test = new Caramel(expresso);

            //Expresso with caramel and chocolate
            var test2 = new Chocolate(new Caramel(expresso));

            client.ClientCode(test);
            Console.WriteLine();

            client.ClientCode(test2);
            Console.WriteLine();

            Console.ReadLine();
        }