Esempio n. 1
0
        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());
        }
Esempio n. 2
0
 public CoffeeCup(CoffeePot coffeePot)
 {
     this.coffeePot = coffeePot;
 }