コード例 #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();
 }