示例#1
0
        internal static iCoffee Create(BrewStyle coffeeType)
        {
            if (!coffees.Exists(coffee => coffee.Style == coffeeType))
                coffees.Add(CoffeeSwitch(coffeeType));

            return coffees.First(coffee => coffee.Style == coffeeType);
        }
示例#2
0
        public void BrewCoffee(BrewStyle coffeeType)
        {
            var coffee = CoffeeFactory.Create(coffeeType);

            coffee.Brew();
            coffee.Pour();
        }
示例#3
0
 internal static iCoffee CoffeeSwitch(BrewStyle coffeeType) =>
     coffeeType switch
     {