コード例 #1
0
        public TriviaGamePresenter(TriviaGameView view, Question[] questions)
        {
            _view      = view;
            _questions = questions;

            Score            = 0;
            _currentQuestion = 0;

            _view.ShowNextQuestion(_questions[_currentQuestion]);
        }
コード例 #2
0
        private void OnRightAnswerReceived()
        {
            Score++;
            _currentQuestion++;

            _view.UpdateScore(Score);

            if (Score == 3)
            {
                _view.ShowWinFeedback();
            }
            else
            {
                _view.ShowPositiveFeedback();
                _view.ShowNextQuestion(_questions[_currentQuestion]);
            }
        }