public Pizza OrderPizza(string type)
        {
            Pizza pizza = SimplePizzaFactory.CreatePizza(type);

            pizza.Prepare();
            pizza.Bake();
            pizza.Cut();
            pizza.Box();
            return(pizza);
        }
示例#2
0
        public Pizza OrderPizza(PizzaType type)
        {
            Pizza pizza = CreatePizza(type);

            pizza.Prepare();
            pizza.Bake();
            pizza.Cut();
            pizza.Box();

            return(pizza);
        }
        public Pizza OrderPizza(params string[] type)
        {
            Pizza pizza = factory.CreatePizza(type);

            pizza.Prepare();
            pizza.Bake();
            pizza.Cut();
            pizza.Box();

            return(pizza);
        }
        static void Main(string[] args)
        {
            PizzaFactory pizzaFactory = new NYPizzaFactory();

            Pizza pizza = pizzaFactory.CreatePizza("Margarita");

            pizza.Prepare();
            pizza.Bake();
            pizza.Cut();
            pizza.Box();
        }
示例#5
0
        static void Main(string[] args)
        {
            PizzaStore dbstore = new DBPizzaStore();
            //PizzaStore bjstore = new BJPizzaStore();

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

            Console.WriteLine(pizza.GetName());
            Console.WriteLine(pizza.Prepare());
            Console.WriteLine(pizza.Cut());
            Console.WriteLine(pizza.Box());
            Console.WriteLine(pizza.Bake());

            //pizza = bjstore.OrderPizza("cheese");
            //Console.WriteLine(pizza.GetName());
        }