/// <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); } }
/// <summary> /// Shows HighScore table /// </summary> /// <param name="position"></param> private void ViewHighScore(int position) { HighScoreWindow scoreWindow = new HighScoreWindow(parentApp); }
/// <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); }