コード例 #1
0
 static void Main(string[] args)
 {
     PizzaFactory pf1 = new NYPizzaStore();
     PizzaFactory pf2 = new CaliforniaPizzaStore();
     pf1.orderPizza("spice");
     pf2.orderPizza("tikka");
 }
コード例 #2
0
        static void Main(string[] args)
        {
            PizzaStore nyPizzaStore = new NYPizzaStore();

            nyPizzaStore.OrderPizza("cheese");

            Console.ReadKey();
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: nandehutuzn/DesignPattern
        static void Main(string[] args)
        {
            PizzaStore nyStore = new NYPizzaStore(); //这里可以创建多个工厂,略
            Pizza      pizza   = nyStore.OrderPizza("cheese");

            Console.WriteLine($"Ethan ordered a {pizza.Name}\n");
            pizza = nyStore.OrderPizza("chicago");
            Console.WriteLine($"Joel ordered a {pizza.Name}\n");

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

            Console.WriteLine("First Order :");
            Pizza pizza = nyStore.OrderPizza("cheese");

            //Console.WriteLine("Second Order :");
            //pizza = chicagoStore.OrderPizza("cheese");
        }
コード例 #5
0
ファイル: Program.cs プロジェクト: DARKinVADER/DesignPatterns
        static void Main(string[] args)
        {
            PizzaStore nyStore      = new NYPizzaStore();
            PizzaStore chicagoStore = new ChicagoPizzaStore();

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

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

            pizza = chicagoStore.OrderPizza("cheese");
            Console.WriteLine($"Joel ordered a {pizza.Name}");
        }
コード例 #6
0
        static void Main(string[] args)
        {
            PizzaStore nyStore      = new NYPizzaStore();
            PizzaStore chicagoStore = new ChicagoPizzaStore();

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

            Console.WriteLine("Luis order a " + pizza.getName() + "\n");

            pizza = chicagoStore.orderPizza("cheese");
            Console.WriteLine("Jorge order a " + pizza.getName() + "\n");
        }
コード例 #7
0
ファイル: Program.cs プロジェクト: sahanesvt/FactoryPattern
        static void Main(string[] args)
        {
            PizzaStore nyStore      = new NYPizzaStore();
            PizzaStore chicagoStore = new ChicagoPizzaStore();

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

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

            pizza = chicagoStore.orderPizza("cheese");
            Console.WriteLine("Joel ordered a " + pizza.getName() + "\n");
        }
コード例 #8
0
        static void Main(string[] args)
        {
            PizzaStore ps = new NYPizzaStore();
            Pizza      pz = ps.Order("Cheese");

            Console.WriteLine("/////////////////////////");

            PizzaStore ps2 = new ChicagoPizzaStore();
            Pizza      pz2 = ps2.Order("Cheese");

            while (true)
            {
            }
        }
コード例 #9
0
ファイル: Program.cs プロジェクト: JvPost/DP
        static void Main(string[] args)
        {
            PizzaStore ny   = new NYPizzaStore();
            PizzaStore chic = new ChicagoPizzaStore();

            Pizza order = ny.OrderPizza("Cheese");

            Console.WriteLine($"Ethan ordered a {order.Name} \n");

            order = chic.OrderPizza("Cheese");
            Console.WriteLine($"Joel ordered a {order.Name}");

            Console.ReadKey();
        }
コード例 #10
0
ファイル: Program.cs プロジェクト: fandrfa/DesignPatterns
        static void Main(string[] args)
        {
            PizzaStore nyPizzaStore      = new NYPizzaStore();
            PizzaStore chicagoPizzaStore = new ChicagoPizzaStore();

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

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

            pizza = chicagoPizzaStore.OrderPizza("cheese");
            Console.WriteLine("Joel ordered a {0}", pizza.GetName());
            Console.WriteLine("");

            Console.ReadLine();
        }
コード例 #11
0
        static void Main(string[] args)
        {
            var nyPizzaStore      = new NYPizzaStore();
            var chicagoPizzaStore = new ChicagoPizzaStore();

            nyPizzaStore.OrderPizza("cheese");
            Console.WriteLine("\n");

            nyPizzaStore.OrderPizza("clam");
            Console.WriteLine("\n");

            chicagoPizzaStore.OrderPizza("cheese");
            Console.WriteLine("\n");

            chicagoPizzaStore.OrderPizza("clam");
        }
コード例 #12
0
        static void Main(string[] args) {
            PizzaStore nyPizzaStore = new NYPizzaStore();
            nyPizzaStore.OrderPizza("cheese");

            Console.ReadKey();
        }