public void ReceiveAnswer() { if (isFirst) { _registration.AddRegisterValue("Points", Points.ToString(), false); _registration.AddRegisterValue("Answer", Answer.ToString(), false); } if (CalculateRight(Answer)) { DebugLog("Right"); QuestionRight(); EndGame(); if (isFirst) { _registration.AddRegisterValue("IsRight", "true", false); } } else { DebugLog("Wrong"); QuestionWrong(); if (isFirst) { _registration.AddRegisterValue("IsRight", "false", false); } } isFirst = false; }
void GameEnded() { if (LockCards != null) { LockCards(); } if (gameWon) { if (_sfxController != null) { _sfxController.PlaySound(victorySfx); } _scoreController.AddScore((int)tempScore, _timeController.TimeSinceGameStart); //CallAction(idVictory); } else { if (_sfxController != null) { _sfxController.PlaySound(gameOverSfx); } //CallAction(idDefeat); _scoreController.AddScore(0, _timeController.TimeSinceGameStart); } if (_registerController != null) { _registerController.AddRegisterValue("MemoryWon", gameWon.ToString(), false); _registerController.AddRegisterValue("MemoryScore", tempScore.ToString(), false); } }
void OnWin() { _register.AddRegisterValue("GameResult", "win", false); _register.AddRegisterValue("GameTrys", _nAssocTrys.ToString(), false); Debug.Log("Win"); CallAction(5); if (_scoreController != null) { _scoreController.AddScore(WinPoints, _timeController.TimeSinceGameStart); } }
public override void EndGame() { base.EndGame(); if (SaveToRegistry) { _registry.AddRegisterValue("QuizType", type.ToString(), false); _registry.AddRegisterValue("QuizAnswers", JsonConvert.SerializeObject(_answers), false); if (_score != null) { if (_timeController != null) { passed = _times.Sum(x => x.Value); } if (WaitShowFeedBack) { passed = _times.Sum(x => x.Value); return; } if (ScoreType == QuizScore.ByQuestion) { if (HasTypes) { _score.AddScore(QuestionsRight, passed, type); } else { _score.AddScore(QuestionsRight, passed); } } } } if (WaitShowFeedBack) { return; } //SendrightQuestionFeedBack(); }