aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'Builders/PizzaBuilder.cs')
-rw-r--r--Builders/PizzaBuilder.cs29
1 files changed, 29 insertions, 0 deletions
diff --git a/Builders/PizzaBuilder.cs b/Builders/PizzaBuilder.cs
new file mode 100644
index 0000000..e86cdaf
--- /dev/null
+++ b/Builders/PizzaBuilder.cs
@@ -0,0 +1,29 @@
+using System.Collections.Generic;
+using KukaPizza.Models;
+
+namespace KukaPizza.Builders
+{
+ public class PizzaBuilder : IPizzaBuilder
+ {
+ PizzaOrder _pizzaOrder = new PizzaOrder();
+ public void ChooseBase(Pizza pizza)
+ {
+ _pizzaOrder.BasePizza = pizza;
+ }
+
+ public void AddExtraToppings(List<Topping> extraToppings)
+ {
+ _pizzaOrder.ExtraToppings = extraToppings;
+ }
+
+ public void ChooseSize(PizzaSize size)
+ {
+ _pizzaOrder.Size = size;
+ }
+
+ public PizzaOrder GetResult()
+ {
+ return _pizzaOrder;
+ }
+ }
+} \ No newline at end of file