コード例 #1
0
        /// <summary>
        /// Event handler for GameWindws close event
        /// </summary>
        /// <param name="sender">Sender object</param>
        /// <param name="gameStatistics">Game statistics</param>
        private void GameWindow_OnGameOver(object sender, GameStatistics gameStatistics)
        {
            ScoreRecord scoreRecord = new ScoreRecord();

            scoreRecord.Score = gameStatistics.Score;

            // Add score into HighScore table
            int scoreIndex = parentApp.HighScore.AddRecord(scoreRecord);

            // Show high score window
            HighScoreWindow scoreWindow = new HighScoreWindow(parentApp);

            // if high score has been reached then edit name
            if (scoreIndex > -1)
            {
                scoreWindow.EditItem(scoreIndex);
            }
        }
コード例 #2
0
ファイル: MainMenuWindow.cs プロジェクト: Zaar152/Samples
 /// <summary>
 /// Shows HighScore table
 /// </summary>
 /// <param name="position"></param>
 private void ViewHighScore(int position)
 {
     HighScoreWindow scoreWindow = new HighScoreWindow(parentApp);
 }