예제 #1
0
        public static void Test()
        {
            NewYorkPizzaStore nyStore = new NewYorkPizzaStore();
            Pizza1            p       = nyStore.OrderPizza("cheese");

            Console.WriteLine(p.Name);

            ChicagoPizzaStore chicagoStore = new ChicagoPizzaStore();
            Pizza1            chp          = chicagoStore.OrderPizza("clam");

            Console.WriteLine(chp.Name);
        }
예제 #2
0
        public override Pizza1 CreatePizza(string type)
        {
            Pizza1 p = null;

            if (type == "cheese")
            {
                p = new ChicagoCheesePizza1();
            }
            else if (type == "clam")
            {
                p = new ChicagoClamPizza1();
            }

            return(p);
        }