public static async Task Run() { var state = new LightStatus(LightState.Red, LightState.Off, 0); while (true) { Console.Clear(); PrintLight(state.Current); state = GetNextState(state); await Task.Delay(1000); } }
private static LightStatus GetNextState(LightStatus status) => status switch { { Current : LightState.Red } => new LightStatus(LightState.Orange, status),