Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            RemoteControl control = new RemoteControl();
            SmartLight    light   = new SmartLight();

            control.SetCommand(new LightOnCommand(light), new LightOffCommand(light));
            SmartConditioner conditioner = new SmartConditioner();

            control.SetCommand(new ConditionerOnCommand(conditioner), new ConditionerOffCommand(conditioner));


            control.SetCommandTemperature(new ConditionerSetTempCommand(conditioner));

            Console.ReadLine();
            control.TurnAll();

            Console.ReadLine();
            control.SetTemperature(67);

            Console.ReadLine();
            control.TurnOff();

            Console.ReadLine();
        }
Ejemplo n.º 2
0
 public LightOffCommand(SmartLight smartLight)
 {
     _smartLight = smartLight;
 }