public Command(Fridge refri, Lights luces, CeilingFan abanico, int estado) { this.fridge = refri; this.lights = luces; this.fan = abanico; this.state = estado; }
static void Main(string[] args) { Fridge refri = new Fridge(); Lights luces = new Lights(); Command commandOn = new ConcreteOn(refri, luces); Command commandOff = new ConcreteOff(refri, luces); Command commandFreeze = new ConcreteFreeze(refri, luces); Command commandAdjust_Temp = new ConcreteAdjust_Temp(refri, luces); Invoker invoker = new Invoker(); invoker.SetCommand(commandOn); invoker.ExecuteCommand(); Console.ReadLine(); }
static void Main(string[] args) { Fridge refri = new Fridge(); Lights luces = new Lights(); CeilingFan abanico = new CeilingFan(); int state = 0; Command commandOn = new ConcreteOn(refri, luces, abanico, state); Command commandOff = new ConcreteOff(refri, luces, abanico, state); Command commandFreeze = new ConcreteFreeze(refri, luces, abanico, state); Command commandAdjust_Temp = new ConcreteAdjust_Temp(refri, luces, abanico, state); Command commandCeilingFan = new ConcreteCeilingFan(refri, luces, abanico, state); Invoker invoker = new Invoker(); //macro command invoker.SetCommand(commandOn); invoker.SetCommand(commandFreeze); invoker.SetCommand(commandCeilingFan); invoker.ExecuteCommand(2); invoker.UndoCommand(); Console.ReadLine(); }
public ConcreteAdjust_Temp(Fridge fridge, Lights lights) : base(fridge, lights) { }
public Command(Fridge refri, Lights luces) { this.fridge = refri; this.lights = luces; }
public ConcreteOff(Fridge fridge, Lights lights) : base(fridge, lights) { }
public ConcreteAdjust_Temp(Fridge fridge, Lights lights, CeilingFan fan, int state) : base(fridge, lights, fan, state) { }
public ConcreteCeilingFan(Fridge refri, Lights luces, CeilingFan fan, int estado) : base(refri, luces, fan, estado) { }
public ConcreteFreeze(Fridge fridge, Lights lights, CeilingFan fan, int state) : base(fridge, lights, fan, state) { }
public ConcreteFreeze(Fridge fridge, Lights lights) : base(fridge, lights) { }