public void Run() { if (MethodPartLogic()) { return; } while (true) { if (MethodPartLogic()) { return; } _output.ShowCurrentColor(_trafficLight.GetCurrentColor()); _trafficLight.SwitchState(); } }
public void Run() { while (true) { _output.ShowCurrentColor(_trafficLight.GetCurrentColor()); if (_input.NeedToExit()) { return; } _trafficLight.SwitchState(); } }