示例#1
0
 public CoffeeMakerAPI()
 {
     _coffeeContainer = new CoffeeContainer();
     _filter          = new Filter();
     _waterStrainer   = new WaterStrainer();
     _warmerPlate     = new WarmerPlate();
 }
示例#2
0
        public CoffeeMaker(ICoffeeMakerAPI hardware)
        {
            this._hardware            = hardware;
            this._boiler              = new Boiler(hardware);
            this._brewButton          = new BrewButton(hardware);
            this._indicatorLight      = new IndicatorLight(hardware);
            this._pressureReliefValve = new PressureReliefValve(hardware);
            this._warmerPlate         = new WarmerPlate(hardware);

            this._brewButton.BrewButtonPushedEvent     += (s, e) => StartBrewCycle();
            this._warmerPlate.WarmerStatusChangedEvent += (s, e) =>
            {
                if (e.WarmerStatus == WarmerStatus.WARMER_EMPTY)
                {
                    StopBrewCycle();
                }
            };
        }