示例#1
0
        static void Main(string[] args)
        {
            var machine = new HotDrinkMachine();

            var coffee = machine.MakeDrink();
            var tea    = machine.MakeDrink();
        }
示例#2
0
        static void Main(string[] args)
        {
            var machine = new HotDrinkMachine();
            var drink   = machine.MakeDrink(HotDrinkMachine.AvailableDrink.Tea, 100);

            drink.Consume();
        }
示例#3
0
        static void Main(string[] args)
        {
            var machine = new HotDrinkMachine();
            var drink   = machine.MakeDrink();

            drink.Consume();
        }
        static void Main(string[] args)
        {
            var machine = new HotDrinkMachine();
            var drink   = machine.MakeDrink();

            //var drink = machine.MakeDrink(HotDrinkMachine.AvailableDrink.Tea, 100); old way, breaks OCP
            drink.Consume();
            Read();
        }