Ejemplo n.º 1
0
 /// <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;
 }
Ejemplo n.º 2
0
        /// <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);
        }