protected PizzaIngredientFactory(IDough dough, ISauce sauce, IClams clams, ICheese cheese)
 {
     Dough  = dough;
     Sauce  = sauce;
     Clams  = clams;
     Cheese = cheese;
 }
Esempio n. 2
0
 public Pizza(
     [Import(typeof(IDough))] IDough dough,
     [Import(typeof(ITopping))] ITopping topping)
 {
     this.Dough   = dough;
     this.Topping = topping;
 }
        public override void Prepare()
        {
            IDough dough = PizzaIngredientFactory.CreateDough();
            ISauce sauce = PizzaIngredientFactory.CreateSauce();

            Console.WriteLine("Preparing Pizza {0}, {1}", dough.Description, sauce.Description);
        }
Esempio n. 4
0
 public Pizza(IIngredientFactory ingredientFactory)
 {
     IngredientFactory = ingredientFactory;
     Dough             = IngredientFactory.CreateDough();
     Sauce             = IngredientFactory.CreateSauce();
     Meat   = IngredientFactory.CreateMeat();
     Veggie = IngredientFactory.CreateVeggie();
 }
Esempio n. 5
0
 public virtual void Prepare()
 {
     Console.WriteLine("Preparing: " + _name);
     _dough     = _ingredientFactory.CreateDough();
     _sauce     = _ingredientFactory.CreateSauce();
     _cheese    = _ingredientFactory.CreateCheese();
     _clams     = _ingredientFactory.CreateClam();
     _pepperoni = _ingredientFactory.CreatePepperoni();
     _veggies   = _ingredientFactory.CreateVeggies();
 }
Esempio n. 6
0
        internal void Prepare()
        {
            Console.Out.WriteLine(String.Format("Preparing {0}.", Name));

            this.dough = pizzaIngredientFactory.CreateDough();
            this.cheeses = pizzaIngredientFactory.CreateCheeses();
            this.sauce = pizzaIngredientFactory.CreateSauce();
            this.toppings = CreateToppings();

            Console.Out.WriteLine("Tossing dough...");
            Console.Out.WriteLine("Adding sauce ...");
            Console.Out.WriteLine("Adding toppings: ");

            foreach(var topping in toppings)
            {
                Console.Out.WriteLine(String.Format("   {0}", topping));
            }
        }
Esempio n. 7
0
        internal void Prepare()
        {
            Console.Out.WriteLine(String.Format("Preparing {0}.", Name));

            this.dough    = pizzaIngredientFactory.CreateDough();
            this.cheeses  = pizzaIngredientFactory.CreateCheeses();
            this.sauce    = pizzaIngredientFactory.CreateSauce();
            this.toppings = CreateToppings();

            Console.Out.WriteLine("Tossing dough...");
            Console.Out.WriteLine("Adding sauce ...");
            Console.Out.WriteLine("Adding toppings: ");

            foreach (var topping in toppings)
            {
                Console.Out.WriteLine(String.Format("   {0}", topping));
            }
        }
Esempio n. 8
0
        static void Main(string[] args)
        {
            IPizzaIngredientFactory ingredientFactory = FactoryProvider.GetPizzaIngredientFactory("NY");
            IDough     dough     = ingredientFactory.GetConcreteProduct <IDough>();
            ISauce     sauce     = ingredientFactory.GetConcreteProduct <ISauce>();
            ICheese    cheese    = ingredientFactory.GetConcreteProduct <ICheese>();
            IVeggies   veggies   = ingredientFactory.GetConcreteProduct <IVeggies>();
            IPepperoni pepperoni = ingredientFactory.GetConcreteProduct <IPepperoni>();
            IClam      clam      = ingredientFactory.GetConcreteProduct <IClam>();

            ingredientFactory.getStyle();
            Console.WriteLine("Состав:");
            dough.AboutMe();
            sauce.AboutMe();
            cheese.AboutMe();
            veggies.AboutMe();
            clam.AboutMe();

            Console.WriteLine("\nЗаменим стиль\n");

            ingredientFactory = FactoryProvider.GetPizzaIngredientFactory("Chicago");
            dough             = ingredientFactory.GetConcreteProduct <IDough>();
            sauce             = ingredientFactory.GetConcreteProduct <ISauce>();
            cheese            = ingredientFactory.GetConcreteProduct <ICheese>();
            veggies           = ingredientFactory.GetConcreteProduct <IVeggies>();
            pepperoni         = ingredientFactory.GetConcreteProduct <IPepperoni>();
            clam = ingredientFactory.GetConcreteProduct <IClam>();


            ingredientFactory.getStyle();
            Console.WriteLine("Состав:");
            dough.AboutMe();
            sauce.AboutMe();
            cheese.AboutMe();
            veggies.AboutMe();
            clam.AboutMe();


            Console.ReadKey();
        }
Esempio n. 9
0
 public WheatDough(IDough dough)
 {
     _dough = dough;
 }
Esempio n. 10
0
 public CinnamonDough(IDough dough)
 {
     _dough = dough;
 }