Пример #1
0
        public static void Main()
        {
            Shop coffeeShop = new Shop();

            IMenuBuilder frenchMenuBuilder  = new FrenchBreakfastBuilder();
            IMenuBuilder italianMenuBuilder = new ItalianBreakfastBuilder();

            coffeeShop.Construct(frenchMenuBuilder);
            Menu frenchMenu = frenchMenuBuilder.GetMenu();

            coffeeShop.Construct(italianMenuBuilder);
            Menu italianMenu = italianMenuBuilder.GetMenu();

            Console.WriteLine(PrintMessages.FrenchBreakfastMenu);
            frenchMenu.Print();

            Console.WriteLine();

            Console.WriteLine(PrintMessages.ItalianBreakfast);
            italianMenu.Print();
        }
Пример #2
0
        static void Main(string[] args)
        {
            CoffeeShopDirector coffeeShop = new CoffeeShopDirector();

            IMenuBuilder frenchMenuBuilder  = new FrenchBreakfastBuilder();
            IMenuBuilder italianMenuBuilder = new ItalianBreakfastBuilder();

            coffeeShop.Construct(frenchMenuBuilder);
            Menu frenchMenu = frenchMenuBuilder.GetMenu();

            coffeeShop.Construct(italianMenuBuilder);
            Menu italianMenu = italianMenuBuilder.GetMenu();

            Console.WriteLine("French Breakfast Menu:");
            frenchMenu.Print();

            Console.WriteLine("Italian Breakfast Menu:");
            italianMenu.Print();

            Console.ReadKey(true);
        }