public void Undo() { if (prevSpeed == CeilingFan.HIGH) { ceilingFan.High(); } else if (prevSpeed == CeilingFan.MEDIUM) { ceilingFan.Medium(); } else if (prevSpeed == CeilingFan.LOW) { ceilingFan.Low(); } else if (prevSpeed == CeilingFan.OFF) { ceilingFan.Off(); } }
public void Execute() { prevSpeed = ceilingFan.GetSpeed(); ceilingFan.High(); }