Ejemplo n.º 1
0
        /// <summary>
        /// Method is used after user wins the game.
        /// It checks if game is eligible for scoreboard, if yes it shows correct window to fill user name.
        /// If not it shows simple popup with time displayed.
        /// </summary>
        protected void Win()
        {
            isGameAvailable = false;
            gameButton.Win();
            stopwatch.Stop();
            bool isEligible;

            if (!isGameReplayed && diffLevel != 3) //checks if entry can be added to scoreboard
            {
                isEligible = scoreboard.IsEligible(stopwatch.GetTime(), diffLevel);
            }
            else
            {
                isEligible = false;
            }
            WinPopUpForm winPopUp = new WinPopUpForm(stopwatch.GetTime(), isEligible);

            winPopUp.ShowDialog();
            if (isEligible && winPopUp.GetIsOkPressed())
            {
                scoreboard.AddEntry(winPopUp.GetScoreboardEntry(), diffLevel);
            }
        }