コード例 #1
0
ファイル: Program.cs プロジェクト: owenhuang91/DesignPattern
        static void Main(string[] args)
        {
            PizzaStore nyStore = new NYStylePizzaStore();
            PizzaStore chicagoStore = new ChicagoStyleStore();

            Pizza pizza = nyStore.orderPizza("cheese");
            Console.WriteLine("Ethan ordered a "+pizza.getName());

            pizza = chicagoStore.orderPizza("cheese");
            Console.WriteLine("Joel ordered a " + pizza.getName());

            Console.ReadLine();
        }
コード例 #2
0
        static void Main(string[] args)
        {
            PizzaStore nyStore      = new NYStylePizzaStore();
            PizzaStore chicagoStore = new ChicagoStyleStore();

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

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

            pizza = chicagoStore.orderPizza("cheese");
            Console.WriteLine("Joel ordered a " + pizza.getName());

            Console.ReadLine();
        }