Esempio n. 1
0
    static void Main(string[] args)
    {
        Thermostat thermostat = new Thermostat();

        Heater heater = new Heater(30);

        Cooler cooler = new Cooler(40);

        thermostat.EmulateTemperatureChange();

        heater.OnTemperatureChanged(thermostat.CurrentTemperature);

        cooler.Update(thermostat.CurrentTemperature);

        thermostat.EmulateTemperatureChange();

        heater.OnTemperatureChanged(thermostat.CurrentTemperature);

        cooler.Update(thermostat.CurrentTemperature);
    }