예제 #1
0
        static void Main(string[] args)
        {
            LightControl ctrl = new LightControl(new OnState());

            ctrl.PressSwich();
            ctrl.PressSwich();
            ctrl.PressSwich();
            ctrl.PressSwich();
            Console.ReadKey();
        }
예제 #2
0
파일: Onstate.cs 프로젝트: umxyz/Zombie
 public void PressSwich(LightControl lightctrl)
 {
     Console.WriteLine("Turn off the light.");
     lightctrl.State = new CloseState();
 }