Пример #1
0
        public static void Main(string[] args)
        {
            flavorFactory = new CoffeeFlavorFactory();

            takeOrders("Cappuccino", 2);
            takeOrders("Cappuccino", 2);
            takeOrders("Frappe", 1);
            takeOrders("Frappe", 1);
            takeOrders("Espresso", 1);
            takeOrders("Frappe", 897);
            takeOrders("Cappuccino", 97);
            takeOrders("Cappuccino", 97);
            takeOrders("Frappe", 3);
            takeOrders("Espresso", 3);
            takeOrders("Cappuccino", 3);
            takeOrders("Espresso", 96);
            takeOrders("Frappe", 552);
            takeOrders("Cappuccino", 121);
            takeOrders("Espresso", 121);

            for (var i = 0; i < ordersMade; ++i)
            {
                flavors [i].serveCoffee(tables [i]);
            }
            Console.WriteLine(" ");
            Console.WriteLine("total CoffeeFlavor objects made: " + flavorFactory.getTotalCoffeeFlavorsMade());
        }
Пример #2
0
        public static void Main(string[] args)
        {
            flavorFactory = new CoffeeFlavorFactory ();

            takeOrders ("Cappuccino", 2);
            takeOrders ("Cappuccino", 2);
            takeOrders ("Frappe", 1);
            takeOrders ("Frappe", 1);
            takeOrders ("Espresso", 1);
            takeOrders ("Frappe", 897);
            takeOrders ("Cappuccino", 97);
            takeOrders ("Cappuccino", 97);
            takeOrders ("Frappe", 3);
            takeOrders ("Espresso", 3);
            takeOrders ("Cappuccino", 3);
            takeOrders ("Espresso", 96);
            takeOrders ("Frappe", 552);
            takeOrders ("Cappuccino", 121);
            takeOrders ("Espresso", 121);

            for (var i = 0; i < ordersMade; ++i) {
                flavors [i].serveCoffee (tables [i]);
            }
            Console.WriteLine (" ");
            Console.WriteLine ("total CoffeeFlavor objects made: " + flavorFactory.getTotalCoffeeFlavorsMade ());
        }