コード例 #1
0
        public void Undo()
        {
            switch (prevSpeed)
            {
            case Fan.HIGH:
                fan.High();
                break;

            case Fan.MEDIUM:
                fan.Medium();
                break;

            case Fan.LOW:
                fan.Low();
                break;

            case Fan.OFF:
                fan.Off();
                break;
            }
        }
コード例 #2
0
 public void Execute()
 {
     prevSpeed = fan.Speed;
     fan.High();
 }