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(); }
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(); }