Ejemplo n.º 1
0
        private static void Main(string[] args)
        {
            SimplePizzaFactory factory    = new SimplePizzaFactory();
            PizzaStore         pizzaStore = new PizzaStore(factory);

            pizzaStore.OrderPizza("cheese");
            Console.ReadKey();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            var f = new SimplePizzaFactory();
            var p = f.Create("Cheese");
            Console.WriteLine(p.Name);

            Console.ReadLine();
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            var f = new SimplePizzaFactory();
            var p = f.Create("Cheese");

            Console.WriteLine(p.Name);

            Console.ReadLine();
        }
        public static void RunClient()
        {
            // Create a new instance of the Factory.
            var factory = new SimplePizzaFactory();
            // Create a new instance of the Client, passing the Factory.
            var pizzaStore = new PizzaStore(factory);
            var pizza      = pizzaStore.OrderPizza("cheese");

            Console.WriteLine("------------------------------------------------");
            pizza = pizzaStore.OrderPizza("pepperoni");
        }
Ejemplo n.º 5
0
        static void Main(string[] args)
        {
            Title.UpperIndent(Assembly.GetExecutingAssembly());

            SimplePizzaFactory simplePizzaFactory = new SimplePizzaFactory();
            PizzaStor          pizzaStor          = new PizzaStor(simplePizzaFactory);

            pizzaStor.OrderPizza(PizzaTypes.Greek);

            Title.BottonIndent();
        }
Ejemplo n.º 6
0
        static void Main(string[] args)
        {
            SimplePizzaFactory factory    = new SimplePizzaFactory();
            PizzaStore         pizzaStore = new PizzaStore(factory);
            Pizza pizza = pizzaStore.OrderPizza("cheese");


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


            Console.ReadKey();
        }
Ejemplo n.º 7
0
        static void Main(string[] args)
        {
            SimplePizzaFactory factory = new SimplePizzaFactory();
            PizzaStore         store   = new PizzaStore(factory);

            IPizza pizza = store.OrderPizza("cheese");

            Console.WriteLine($"We ordered a {pizza.Name}");
            //Console.WriteLine(pizza);
            Console.WriteLine("-------------------------");
            pizza = store.OrderPizza("veggie");
            Console.WriteLine($"We ordered a {pizza.Name}");
            //Console.WriteLine(pizza);
        }
Ejemplo n.º 8
0
        private static void Main()
        {
            var factory = new SimplePizzaFactory();
            var store   = new PizzaStore(factory);

            var pizza = store.OrderPizza("cheese");

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

            pizza = store.OrderPizza("veggie");
            Console.WriteLine($"We ordered a {pizza.Name}");
            Console.WriteLine(pizza);
        }
Ejemplo n.º 9
0
 public PizzaStor(SimplePizzaFactory simplePizzaFactory)
 {
     SimplePizzaFactory = simplePizzaFactory;
 }
Ejemplo n.º 10
0
 public PizzaStore(SimplePizzaFactory factory)
 {
     this.factory = factory;
 }
Ejemplo n.º 11
0
 public PizzaStore(SimplePizzaFactory pizzaFactory)
 {
     factory = pizzaFactory;
 }
Ejemplo n.º 12
0
 public PizzaStore(SimplePizzaFactory factory)
 {
     _factory = factory;
 }