예제 #1
0
 public void Run()
 {
     if (MethodPartLogic())
     {
         return;
     }
     while (true)
     {
         if (MethodPartLogic())
         {
             return;
         }
         _output.ShowCurrentColor(_trafficLight.GetCurrentColor());
         _trafficLight.SwitchState();
     }
 }
예제 #2
0
 public void Run()
 {
     while (true)
     {
         if (_input.NeedToExit())
         {
             return;
         }
         _trafficLight.SwitchState();
     }
 }
예제 #3
0
 public void Run()
 {
     while (true)
     {
         _output.ShowCurrentColor(_trafficLight.GetCurrentColor());
         if (_input.NeedToExit())
         {
             return;
         }
         _trafficLight.SwitchState();
     }
 }