From b1eb36d3fbc5012b07489454a7452e8488507f6a Mon Sep 17 00:00:00 2001 From: marcinzelent Date: Sun, 21 Feb 2021 14:13:49 +0100 Subject: Initial commit --- Builders/PizzaBuilder.cs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Builders/PizzaBuilder.cs (limited to 'Builders/PizzaBuilder.cs') 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 extraToppings) + { + _pizzaOrder.ExtraToppings = extraToppings; + } + + public void ChooseSize(PizzaSize size) + { + _pizzaOrder.Size = size; + } + + public PizzaOrder GetResult() + { + return _pizzaOrder; + } + } +} \ No newline at end of file -- cgit v1.2.3