Beispiel #1
0
        public void Order(CoffeeMachine coffee)
        {
            Console.WriteLine($"{this.Name} ordered an {coffee.coffee.Name} {coffee.coffee.Type} Coffee" +
                              $" which has to be {coffee.grinder.Size} grinded " +
                              $" using a {coffee.tank.Size} {coffee.tank.Form} water tank.");

            coffee.MakeCoffee();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Person        client    = new Person("Rebe");
            Americano     americano = new Americano("Americano", "black");
            CoffeeMachine first     = new CoffeeMachine(americano,
                                                        new Grinder("medium"),
                                                        new WaterTank("small", "square"));
            Expresso      expresso = new Expresso("Expresso", "light");
            CoffeeMachine second   = new CoffeeMachine(expresso,
                                                       new Grinder("fine"),
                                                       new WaterTank("big", "sphere"));

            client.Order(first);
            client.Order(second);

            Console.ReadKey();
        }