private static int QuestionToPoints(ITriviaQuestion question) { if (question.Type == TriviaQuestionType.TrueFalse) { return(1); } else if (question.Type == TriviaQuestionType.MultipleChoice) { switch (question.Difficulty) { case TriviaQuestionDifficulty.Easy: return(1); case TriviaQuestionDifficulty.Medium: return(2); case TriviaQuestionDifficulty.Hard: return(3); default: return(0); } } return(0); }
private static int QuestionToPoints(ITriviaQuestion question) { return(question.Type switch { TriviaQuestionType.TrueFalse => 1, TriviaQuestionType.MultipleChoice => question.Difficulty switch { TriviaQuestionDifficulty.Easy => 1, TriviaQuestionDifficulty.Medium => 2, TriviaQuestionDifficulty.Hard => 3, _ => 0, },