public void ClickAnswer() { string name = transform.parent.name; switch (name) { case "AnswerA": currentAnswer = Question.PossibleAnswer.A; break; case "AnswerB": currentAnswer = Question.PossibleAnswer.B; break; case "AnswerC": currentAnswer = Question.PossibleAnswer.C; break; case "AnswerD": currentAnswer = Question.PossibleAnswer.D; break; } Singleton.EventManager.Raise(new AnswerClickResult(currentAnswer)); }
// public bool CheckAnswer_AndIfItsEnd(Question.PossibleAnswer answer) { int score = (int)currentQuestionTime * 10; if (answer == currentQuestion.correctAnswer) { AddPointsToScore(score); isCorrect = true; return(false); } else { isCorrect = false; OnBadAnswer(); LivesLeft -= 1; if (LivesLeft == 0) { return(true); } else { return(false); } } }
public void CheckAnswer(Question.PossibleAnswer answer) { if (answer == currentQuestion.correctAnswer) { AddPointsToScore(50); isCorrect = true; } else { RemovePointsFromScore(50); isCorrect = false; } }
// private void ChangeColors(AnswerClick.AnswerClickResult evt) { Question.PossibleAnswer correctAnswer = currentQuestion.correctAnswer; if (evt.answer == correctAnswer) { Blink(ButtonRelationToAnswer(evt.answer)); } else { Blink(ButtonRelationToAnswer(correctAnswer)); ButtonRelationToAnswer(evt.answer).color = new Color(255, 0, 0); } }
// private Image ButtonRelationToAnswer(Question.PossibleAnswer answer) { switch (answer) { case Question.PossibleAnswer.A: return(answerA); case Question.PossibleAnswer.B: return(answerB); case Question.PossibleAnswer.C: return(answerC); case Question.PossibleAnswer.D: return(answerD); default: return(null); } }
public AnswerClickResult(Question.PossibleAnswer currentAnswer) { answer = currentAnswer; }