private void DisplayAnswerResult(CommitAnswerResult commitAnswerResult)
 {
     if (commitAnswerResult.WasAnswerCorrect)
     {
         _gameView.Button(commitAnswerResult.UserAnswer).SetState(AnswerButtonState.CorrectAnswer);
         //ServiceLocator.Sound.PlayEffect(gfx.SoundEffect.QuestionCommitted);
         ServiceLocator.Sound.PlayEffect(gfx.SoundEffect.Applause);
     }
     else
     {
         _gameView.Button(commitAnswerResult.UserAnswer).SetState(AnswerButtonState.WrongAnswer);
         _gameView.Button(commitAnswerResult.CorrectAnswer).SetState(AnswerButtonState.CorrectAnswer);
     }
 }
Ejemplo n.º 2
0
        internal CommitAnswerResult CommitAnswer(AnswerCode answer, GameController game)
        {
            CommitAnswerResult result = new CommitAnswerResult(answer, _correctAnswerCode);

            if (result.WasAnswerCorrect)
            {
                _question.Usage.IncreaseCorrectAnswersCount();
            }
            else
            {
                _question.Usage.IncreaseWrongAnswersCount();                
            }

            game.QuestionRepository.SaveQuestion(_question);

            return result;
        }
Ejemplo n.º 3
0
        internal CommitAnswerResult CommitAnswer(AnswerCode answer, GameController game)
        {
            CommitAnswerResult result = new CommitAnswerResult(answer, _correctAnswerCode);

            if (result.WasAnswerCorrect)
            {
                _question.Usage.IncreaseCorrectAnswersCount();
            }
            else
            {
                _question.Usage.IncreaseWrongAnswersCount();
            }

            game.QuestionRepository.SaveQuestion(_question);

            return(result);
        }