コード例 #1
0
        static void Main(string[] args)
        {
            PizzaStore chicago = new ChicagoPizzaStore();
            PizzaStore ny      = new NYPizzaStore();

            Pizza pizzaChicago = chicago.OrderPizza("chicago");
            Pizza pizzaNY      = ny.OrderPizza("NY");
        }
コード例 #2
0
        static void Main(string[] args)
        {
            var nYPizzaStore  = new NYPizzaStore();
            var nyCheesePizza = nYPizzaStore.OrderPizza("cheese");

            var chicagoPizzaStore     = new ChicagoPizzaStore();
            var chicagoPepperoniPizza =
                chicagoPizzaStore.OrderPizza("pepperoni");
        }
コード例 #3
0
        static void Main(string[] args)
        {
            PizzaStore nyStore      = new NYPizzaStore();
            PizzaStore chicagoStore = new ChicagoPizzaStore();

            Pizza pizza = nyStore.orderPizza("cheese");

            Console.WriteLine("Ethan ordered a " + pizza.getName());

            pizza = chicagoStore.orderPizza("cheese");
            Console.WriteLine("Joel ordered a " + pizza.getName());
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: sibstark/DesignPatterns
        static void Main(string[] args)
        {
            var nyPizzaStore      = new NYPizzaStore();
            var chicagoPizzaStore = new ChicagoPizzaStore();

            var chicagoPizza      = chicagoPizzaStore.OrderPizza("Chicago");
            var chicagoCheezPizza = chicagoPizzaStore.OrderPizza("cheez");

            var nyPizza      = nyPizzaStore.OrderPizza("cheez");
            var nyCheezPizza = nyPizzaStore.OrderPizza("NY");

            Console.ReadKey();
        }
コード例 #5
0
        static void Main(string[] args)
        {
            StoreBase nyStore      = new NYPizzaStore();
            StoreBase chicagoStore = new ChicagoPizzaStore();

            PizzaBase pizza = nyStore.OrderPizza(PizzaType.Cheese);

            Console.WriteLine($"Ethan ordered a {pizza.GetName()}");

            pizza = chicagoStore.OrderPizza(PizzaType.Cheese);
            Console.WriteLine($"Joel ordered a {pizza.GetName()}");

            Console.ReadLine();
        }
コード例 #6
0
        static void Main(string[] args)
        {
            PizzaStore NYPizzaStore = new NYPizzaStore();
            PizzaStore ChicagoStore = new ChicagoPizzaStore();

            Pizza pizza = NYPizzaStore.OrderPizza("cheese");

            Console.WriteLine($"Yue ordered a {pizza.getName()}");

            pizza = ChicagoStore.OrderPizza("cheese");
            Console.WriteLine($"Larry ordered a {pizza.getName()}");

            NYPizzaStore.OrderPizza("cheese");
        }
コード例 #7
0
ファイル: Program.cs プロジェクト: helintonf/DesignPatterns
        private static void Main(string[] args)
        {
            Console.WriteLine("Hello Pizza World!");

            var nyStore      = new NYPizzaStore();
            var chicagoStore = new ChicagoPizzaStore();

            Pizza pizza = nyStore.Order("cheese");

            Console.WriteLine($"Helinton ordered a {pizza.Name}");

            pizza = chicagoStore.Order("cheese");
            Console.WriteLine($"Helinton ordered a {pizza.Name}");
        }
コード例 #8
0
ファイル: Program.cs プロジェクト: linhduydinh/DesignPatterns
        static void Main(string[] args)
        {
            string nyType = Console.ReadLine();
            //string chicagoType = Console.ReadLine();


            NYPizzaStore      nYPizzaStore      = new NYPizzaStore();
            ChicagoPizzaStore chicagoPizzaStore = new ChicagoPizzaStore();

            var pizza = nYPizzaStore.orderPizza(nyType);

            Console.WriteLine("Ethan ordered a " + pizza.getName() + "\n");

            //pizza =  chicagoPizzaStore.orderPizza(chicagoType);
            //Console.WriteLine("Ethan ordered a " + pizza.getName() + "\n");
        }
コード例 #9
0
        static void Main(string[] args)
        {
            PizzaStore nyStore      = new NYPizzaStore();
            PizzaStore chicagoStore = new ChicagoPizzaStore();

            Pizza pizza = nyStore.OrderPizza("cheese");

            Console.WriteLine($"Ethan ordered a {pizza.Name}");

            Console.WriteLine();

            pizza = chicagoStore.OrderPizza("cheese");
            Console.WriteLine($"Joel ordered a {pizza.Name}");

            Console.ReadLine();
        }
コード例 #10
0
        static void Main(string[] args)
        {
            StoreBase nyStore      = new NYPizzaStore();
            StoreBase chicagoStore = new ChicagoPizzaStore();

            PizzaBase pizza = nyStore.OrderPizza(PizzaType.Cheese);

            pizza.DescribeIngredients();

            pizza = chicagoStore.OrderPizza(PizzaType.Cheese);
            pizza.DescribeIngredients();

            Console.WriteLine("Time for a second round of Pizza!");

            pizza = nyStore.OrderPizza(PizzaType.Special);
            pizza.DescribeIngredients();

            pizza = chicagoStore.OrderPizza(PizzaType.Special);
            pizza.DescribeIngredients();

            Console.ReadLine();
        }