public void StartGame(QuizzType quizzType) { Quiz = LoadQuiz(quizzType); switch (quizzType) { case QuizzType.Performance: _welcomePage.NextPage = _performanceGamePage; _endPage.PreviousPage = _performanceGamePage; break; case QuizzType.Allocation: _welcomePage.NextPage = _allocationGamePage; _endPage.PreviousPage = _allocationGamePage; break; case QuizzType.Performance2018: _welcomePage.NextPage = _performance2018GamePage; _endPage.PreviousPage = _performance2018GamePage; break; default: throw new ArgumentOutOfRangeException(nameof(quizzType), quizzType, null); } }
private static string GetQuizPath(QuizzType quizzType) { var quizPathRoot = GetQuizPathRoot(); if (string.IsNullOrEmpty(quizPathRoot)) throw new InvalidOperationException("Unable to locate quiz path, you should set \"Quiz.Path\" setting key."); return Path.Combine(quizPathRoot, quizzType.ToString(), "Questions"); }
private static string GetQuizPath(QuizzType quizzType) { var quizPathRoot = GetQuizPathRoot(); if (string.IsNullOrEmpty(quizPathRoot)) { throw new InvalidOperationException("Unable to locate quiz path, you should set \"Quiz.Path\" setting key."); } return(Path.Combine(quizPathRoot, quizzType.ToString(), "Questions")); }
public void StartGame(QuizzType quizzType) { Quiz = LoadQuiz(quizzType); switch (quizzType) { case QuizzType.Performance: _welcomePage.NextPage = _performanceGamePage; _endPage.PreviousPage = _performanceGamePage; break; case QuizzType.Allocation: _welcomePage.NextPage = _allocationGamePage; _endPage.PreviousPage = _allocationGamePage; break; default: throw new ArgumentOutOfRangeException(nameof(quizzType), quizzType, null); } }
private static Quiz LoadQuiz(QuizzType quizzType) => QuizLoader.LoadFrom(GetQuizPath(quizzType));
private static Quiz LoadQuiz(QuizzType quizzType) { return(QuizLoader.LoadFrom(GetQuizPath(quizzType))); }
private static Quiz LoadQuiz(QuizzType quizzType) { return QuizLoader.LoadFrom(GetQuizPath(quizzType)); }