static void Main(string[] args) { var coffeeCup = new CoffeeCup(); var coffeePot = new CoffeePot(); var workTask = new WorkTask(); do { coffeeCup.Drink(); workTask.Execute(); if (coffeeCup.Empty()) { if (coffeePot.Empty()) { coffeePot.Make(); } coffeeCup.Refill(); } } while (!workTask.Done()); }
public CoffeeCup(CoffeePot coffeePot) { this.coffeePot = coffeePot; }