public static void Main()
        {
            PizzaStore NYStore      = new NYStylePizzaStore();
            PizzaStore ChicagoStore = new ChicagoStylePizzaStore();

#pragma warning disable RECS0091 // Use 'var' keyword when possible
            Pizza pizza = NYStore.OrderPizza("cheese");
#pragma warning restore RECS0091 // Use 'var' keyword when possible
            Console.WriteLine($"Ethan ordered a {pizza.Name}.");

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

            Console.ReadLine();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            PizzaStore NYStore = new NYStylePizzaStore();

            Pizza pizza1 = NYStore.OrderPizza("cheese");

            PizzaStore chicagoStore = new ChicagoStylePizzaStore();
            Pizza      pizza2       = chicagoStore.OrderPizza("peperoni");

            Console.WriteLine(pizza1.Prepare() + "\n" + pizza1.Bake() +
                              "\n" + pizza1.Cut() + "\n" + pizza1.Box());

            Console.WriteLine("*************************");

            Console.WriteLine(pizza2.Prepare() + "\n" + pizza2.Bake() +
                              "\n" + pizza2.Cut() + "\n" + pizza2.Box());

            Console.ReadKey();
        }
Beispiel #3
0
        public static void Main(string[] args)
        {
            // Here I am declaring both of my Pizza Store to order same type of pizza for both of the store.
            PizzaStore NYPizzaStore      = new NYStylePizzaStore();
            PizzaStore ChicagoPizzaStore = new ChicagoStylePizzaStore();

            Console.WriteLine("Welcome to my Pizza Store!");
            Console.WriteLine("Please enter your pizza type from");
            Console.WriteLine("(Cheese)(Clam)");
            var pizzaType = Console.ReadLine();

            // Now NY Pizza Store is prepare my order.
            var NYPizza = NYPizzaStore.OrderPizza(pizzaType);

            // Here I am returning my pizza that I have received from NY Pizza Store.
            if (NYPizza != null)
            {
                Console.WriteLine("Thank for Ordering " + NYPizza.GetType() + " please collect your order from front desk in 15 min");
            }
            else
            {
                Console.WriteLine("We are sorry to serve you today. Facing issue with the system.");
            }

            // Now Chicago Pizza Store is prepare my order.
            var ChicagoPizza = ChicagoPizzaStore.OrderPizza(pizzaType);

            // Here I am returning my pizza that I have received from NY Pizza Store.
            if (ChicagoPizza != null)
            {
                Console.WriteLine("Thank for Ordering " + ChicagoPizza.GetType() + " please collect your order from front desk in 15 min");
            }
            else
            {
                Console.WriteLine("We are sorry to serve you today. Facing issue with the system.");
            }
        }