예제 #1
0
 public override string ToString()
 {
     return($"Dough: {Dough.GetType().Name}\n" +
            $"Sauce: {Sauce.GetType().Name}\n" +
            $"Cheese: {Cheese.GetType().Name}\n" +
            $"Veggies: {string.Join(", ", Veggies.Select(n => n.GetType().Name).ToArray())}\n");
 }
예제 #2
0
 public override string ToString()
 {
     return($"Dough: {Dough.GetType().Name}\n" +
            $"Sauce: {Sauce.GetType().Name}\n" +
            $"Cheese: {Cheese.GetType().Name}\n" +
            $"Clam: {Clam.GetType().Name}\n");
 }
        public void DescribeIngredients()
        {
            Console.WriteLine("");
            Console.WriteLine("---------------------------------------");
            Console.WriteLine($"This pizza is a {Name}");

            if (Dough != null)
            {
                Console.WriteLine($"Dough is {Dough.GetType().Name} ");
            }

            if (Sauce != null)
            {
                Console.WriteLine($"Sauce is {Sauce.GetType().Name} ");
            }

            if (Cheese != null)
            {
                Console.WriteLine($"Cheese is {Cheese.GetType().Name} ");
            }

            if (Meat != null)
            {
                Console.WriteLine($"Meat is {Meat.GetType().Name} ");
            }

            Console.WriteLine("---------------------------------------");
            Console.WriteLine("");
        }
예제 #4
0
 public override string ToString()
 {
     return($"Dough: {Dough.GetType().Name}\n" +
            $"Sauce: {Sauce.GetType().Name}\n" +
            $"Cheese: {Cheese.GetType().Name}\n" +
            $"Pepperoni: {Pepperoni.GetType().Name}\n");
 }
예제 #5
0
        public override void Prepare()
        {
            Dough  = ingredientFactory.CreateDough();
            Cheese = ingredientFactory.CreateCheese();
            Clams  = ingredientFactory.CreateClams();
            Sauce  = ingredientFactory.CreateSause();

            Console.WriteLine($"Preparing {Name}");
            Console.WriteLine(Dough.GetType().ToString());
            Console.WriteLine(Sauce.GetType().ToString());
            Console.WriteLine(Cheese.GetType().ToString());
            Console.WriteLine(Clams.GetType().ToString());
        }
예제 #6
0
        public override void Prepare()
        {
            Pepperoni = ingredientFactory.CreatePepperoni();
            Dough     = ingredientFactory.CreateDough();
            Sauce     = ingredientFactory.CreateSause();
            Veggies   = ingredientFactory.CreateVeggies();

            Console.WriteLine($"Preparing {Name}");
            Console.WriteLine(Pepperoni.GetType().ToString());
            Console.WriteLine(Dough.GetType().ToString());
            Console.WriteLine(Sauce.GetType().ToString());

            foreach (var item in Veggies)
            {
                Console.WriteLine(item.GetType().ToString());
            }
        }