private void OpenTestingMode()
        {
            if (GamePartialSave())
            {
                QuestionsWindow questionWindow = new QuestionsWindow(true, _storage, _game, _wereThereAlreadySomeChangings);

                questionWindow.Show();
            }
        }
        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            if (!_goingToPlayGame)
            {
                PlayingModeWindow playingModeWindow = new PlayingModeWindow(_storage);

                playingModeWindow.Show();
            }

            else
            {
                QuestionsWindow questionsWindow = new QuestionsWindow(false, _storage, _game, false);

                questionsWindow.Show();
            }
        }
        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            if (_restartingTheGame)
            {
                if (_testingMode)
                {
                    QuestionsWindow questionsWindow = new QuestionsWindow(_testingMode, _storage, _game,
                                                                          _wereThereAlreadySomeChangings);
                    questionsWindow.Show();
                }
                else
                {
                    IGame game = _game;
                    game.UpdatePicture(_game.Picture);

                    UpdatePopularity();

                    DescriptionOfGameWindow discriptionOfGameWindow = new DescriptionOfGameWindow(_storage, game);

                    discriptionOfGameWindow.Show();
                }
            }

            else
            {
                if (!_testingMode)
                {
                    UpdatePopularity();

                    PlayingModeWindow playingModeWindow = new PlayingModeWindow(_storage);

                    playingModeWindow.Show();
                }
                else
                {
                    Developer_III_Window developerWindow = new Developer_III_Window(
                        _storage.Users.Items.First(u => u.Id == _game.UserId), _game,
                        _storage, _wereThereAlreadySomeChangings);
                    developerWindow.Show();
                }
            }
        }
Exemplo n.º 4
0
        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            if (_goingForward && _goingToTheEndOfTheGameWindow)
            {
                EndOfGameWindow endOfGameWindow = new EndOfGameWindow(_testingMode, _storage, _game,
                                                                      _localCharacteristics, _wereThereAlreadySomeChangings);

                endOfGameWindow.Show();
            }

            else if (_goingForward && _goingToTheNextQuestionWindow)
            {
                QuestionsWindow questionsWindow = new QuestionsWindow(_testingMode, _storage, _game,
                                                                      _numberOfQuestionsShown, _localCharacteristics, _wereThereAlreadySomeChangings);

                questionsWindow.Show();
            }

            else
            {
                if (!_testingMode)
                {
                    PlayingModeWindow playingModeWindow = new PlayingModeWindow(_storage);

                    _storage.CloseGame();

                    playingModeWindow.Show();
                }

                else
                {
                    Developer_III_Window developerWindow = new Developer_III_Window(
                        _storage.Users.Items.First(u => u.Id == _game.UserId),
                        _game, _storage, _wereThereAlreadySomeChangings);
                    developerWindow.Show();
                }
            }
        }