Exemple #1
0
        private void QuizManager_OnRoundEnd()
        {
            double p1 = Players[0].Points;
            double p2 = Players[1].Points;
            double p3 = Players[2].Points;

            if (!(p1 != p2 && p2 != p3 && p1 != p3))
            {
                MediaDockPanel.Visibility = Visibility.Collapsed;
                quizManager.AddExtraQuestion();
                quizManager.Next();
                return;
            }

            if (dbWorker.CheckContinueRound())
            {
                dbWorker.UpdateCurrentRound(RoundNumber + 1);
                dbWorker.UpdateCurrentQuestion(0);

                Thread thread = new Thread(() => {
                    Process.Start(Path.Combine(Environment.CurrentDirectory, "Quiz.exe"));
                });
                thread.Start();

                quizManager.StopQuiz();
                registrationManager.StopManager();
                buttonConnector.AbortAll();

                this.Close();
            }
            else
            {
                MessageBox.Show("Игра окончена.");

                quizManager.StopQuiz();
                registrationManager.StopManager();
                buttonConnector.AbortAll();
                this.Close();
            }
        }