Beispiel #1
0
        private void OnGameOver()
        {
            Game.Over();
            GameTimer.Enabled = false;

            TetrisSave test;

            if (Game.Score > Game.Score2)
            {
                test = new TetrisSave("---", Game.Score, DateTime.Now - Game.GameStarted);//////////////////////
            }
            else//Game.Score<=Game.Score2
            {
                test = new TetrisSave("---", Game.Score2, DateTime.Now - Game.GameStarted);//////////////////////
            }

            if (Saver.HighScores.CanAdd(test) || Saver.HighTimes.CanAdd(test))
            {
                NRDialog = new NewRecordDialog();
                if (NRDialog.ShowDialog() == DialogResult.OK)
                {
                    test.UserName = NRDialog.UserName;
                    Saver.Save(test);

                    RForm = new RecordsForm(test);
                    if (RForm.ShowDialog() == DialogResult.OK)
                    {
                        NewGame();
                    }
                }
            }
        }
Beispiel #2
0
        private void OnGameOver()
        {
            tetrisGame.Over();
            tmrGame.Enabled = false;

            TetrisSave test = new TetrisSave("---", tetrisGame.Score, DateTime.Now - tetrisGame.GameStarted);

            //判断是否可以上榜
            if (Saver.highScores.CanAdd(test) || Saver.highTimes.CanAdd(test))
            {
                newRecordDialog = new NewRecord();
                if (newRecordDialog.ShowDialog() == DialogResult.OK)
                {
                    //存档
                    test.UserName = newRecordDialog.UserName;
                    Saver.Save(test);

                    //打开排行榜
                    rankingList = new RankingList(test);
                    if (rankingList.ShowDialog() == DialogResult.OK)
                    {
                        NewGame();
                    }
                }
            }
        }
Beispiel #3
0
        private void OnGameOver()
        {
            Game.Over();
            GameTimer.Enabled = false;

            TetrisSave test = new TetrisSave("---", Game.Score, DateTime.Now - Game.GameStarted);

            if (Saver.HighScores.CanAdd(test) || Saver.HighTimes.CanAdd(test))
            {
                Saver.Save(test);
            }
        }