Ejemplo n.º 1
0
        private static void MakePizza(string[] tokens)
        {
            var numOfTopping = int.Parse(tokens[2]);

            var pizza = new Pizza(tokens[1], numOfTopping);

            var doughInfo = Console.ReadLine().Split(' ');

            var dough = new Dough(doughInfo[1], doughInfo[2], double.Parse(doughInfo[3]));

            pizza.Dough = dough;

            for (int i = 0; i < numOfTopping; i++)
            {
                var topInfo = Console.ReadLine().Split(' ');

                var topping = new Topping(topInfo[1], double.Parse(topInfo[2]));

                pizza.AddTopping(topping);
            }

            Console.WriteLine($"{pizza.Name} - {pizza.GetPizzaCalories():f2} Calories.");
        }
Ejemplo n.º 2
0
 public void AddTopping(Topping topping)
 {
     this.toppings.Add(topping);
 }