Exemple #1
0
        /// <summary>
        /// Invoke when player give a right answer
        /// </summary>
        /// <param name="points"></param>
        private void QuizManager_OnRightAnswer(double points, bool isInvokeFromThis = false)
        {
            if (!isInvokeFromThis)
            {
                ActivePlayer = Players[activePlayerIndex];
            }

            ShowBlacker();
            RightAnswerGrid.Visibility = Visibility.Visible;

            AddPoints(activePlayerIndex, points);
            Players[activePlayerIndex].ChangeStatus(PlayerStatus.Registered);

            foreach (Player p in Players)
            {
                p.AnswerTime = "";
                p.isAnswered = false;
            }
            isPlayerAnswering = false;

            dbWorker.UpdatePoints(activePlayerIndex, Players[activePlayerIndex].Points);
            dbWorker.UpdateCurrentQuestion(QuestionNumber);
        }