static void Main(string[] args) { LightControl ctrl = new LightControl(new OnState()); ctrl.PressSwich(); ctrl.PressSwich(); ctrl.PressSwich(); ctrl.PressSwich(); Console.ReadKey(); }
public void PressSwich(LightControl lightctrl) { Console.WriteLine("Turn off the light."); lightctrl.State = new CloseState(); }