コード例 #1
0
ファイル: QuestionsList.cs プロジェクト: SerGreen/GeoQuizCore
 /// <summary>
 /// This constructor should be used to create a list.
 /// </summary>
 public QuestionsList(List <Country> countries, QuestionBuilder builder)
 {
     this.countries = countries;
     this.CurrentQuestionAnswerPair = builder?.GetNextQuestion(countries[CurrentQuestionIndex]);
     CurrentQuestionIndex           = 0;
     CorrectAnswersCount            = 0;
     WrongAnswersCount = 0;
 }
コード例 #2
0
ファイル: QuestionsList.cs プロジェクト: SerGreen/GeoQuizCore
        /// <summary>
        /// Returns True if question was successfully switched; False if the end is reached
        /// </summary>
        public bool AdvanceToNextQuestion(QuestionBuilder questionBuilder)
        {
            CurrentQuestionIndex++;
            if (EndReached)
            {
                return(false);
            }

            CurrentQuestionAnswerPair = questionBuilder.GetNextQuestion(countries[CurrentQuestionIndex]);
            return(true);
        }