public void Undo() { if (_prevCommand == _fan.HIGH) { _fan.High(); } else if (_prevCommand == _fan.MEDIUM) { _fan.Medium(); } else if (_prevCommand == _fan.LOW) { _fan.Low(); } else if (_prevCommand == _fan.OFF) { _fan.Off(); } }
public void Execute() { _prevCommand = _fan.Speed; _fan.Off(); }