public char GetUsersNextAction(List <String> options, List <char> validResponses) { while (true) { WriteOptions(options); char response = reader.ReadInCharacter(); if (!UserResponse.IsValidResponse(validResponses, response)) { WriteInvalidResponse(); } else { return(response); } } }
public char GetYesOrNoAnswer(string question) { List <char> validResponses = new List <char>() { UserResponse.YES, UserResponse.NO }; while (true) { writer.WriteLine($"{question} ({UserResponse.YES}/{UserResponse.NO})"); char response = reader.ReadInCharacter(); if (!UserResponse.IsValidResponse(validResponses, response)) { WriteInvalidResponse(); } else { return(response); } } }