Exemplo 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();
        }
Exemplo n.º 2
0
 public ConditionerSetTempCommand(SmartConditioner smartConditioner)
 {
     _smartConditioner = smartConditioner;
 }
Exemplo n.º 3
0
 public ConditionerOffCommand(SmartConditioner smartConditioner)
 {
     _smartConditioner = smartConditioner;
 }