Exemple #1
0
 private void highscoreToolStripMenuItem_Click(object sender, EventArgs e)
 {
     frmHighscoreDisplay displayHS = new frmHighscoreDisplay();
     displayHS.ShowDialog();
 }
Exemple #2
0
        public void GameFinished()
        {
            bool newHighscoreInput = Highscore.GetInstance()
                                         .AddHighscore(game.Player, YambTable.GetInstance().GetTotalPoints(), 0);
            if (newHighscoreInput)
            {
                frmHighscoreDisplay displayHS = new frmHighscoreDisplay(Highscore.GetInstance().insertedRank);
                displayHS.ShowDialog();
                try
                {
                    Serializer serializer = new Serializer();
                    serializer.SerializeObject("db.dat", Highscore.GetInstance());
                }
                catch (Exception)
                {
                    MessageBox.Show(
                        "The application has no access to db.dat file or the file is corrupted!\nReinstall the program to a location where they are no administrator rights necessary.\neg.: C:\\");
                    this.Close();
                }
            }

            frmEndGame endGameForm = new frmEndGame();
            bool newGame = endGameForm.ShowPoints(YambTable.GetInstance().GetTotalPoints());

            if (newGame)
            {
                StartNewGame();
            }
            else
            {
                this.Close();
            }
        }