forked from abishekaditya/DesignPatterns
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCheesePizza.cs
More file actions
25 lines (23 loc) · 758 Bytes
/
Copy pathCheesePizza.cs
File metadata and controls
25 lines (23 loc) · 758 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using System;
namespace FactoryPattern
{
class CheesePizza : Pizza
{
readonly IIngredientsFactory _ingredients;
public CheesePizza(IIngredientsFactory ing)
{
_ingredients = ing;
}
internal override void Prepare()
{
Console.WriteLine("Preparing " + Name + " Using");
Console.Write("Dough: " + _ingredients.CreateDough().Name + ", Cheese: " + _ingredients.CreateCheese().Name + ", Sauce: " + _ingredients.CreateSauce().Name + ", Veggies: ");
Console.WriteLine();
foreach (var val in _ingredients.CreateVeggies())
{
Console.Write(val.Name + " ");
}
Console.WriteLine();
}
}
}