private void Form1_Load(object sender, EventArgs e) { HighScore.CreateFolders(); HighScore.CheckHighscoreExsist(); if (SaveGameSettings.music == true) { EndScreenMusic.Play(); } HighScore.SortPlayer(); if (WinnerList.list.Count > 1) { Console.WriteLine("not null"); if (WinnerList.list[0].Score == WinnerList.list[1].Score) { labelWinningPlayer.Text = "The game is a draw"; } else { // Displays the winner alone on screen. labelWinningPlayer.Text = WinnerList.list[0].Name + " has won with the score of: " + WinnerList.list[0].Score + "!"; } } else { // Displays the winner alone on screen. labelWinningPlayer.Text = WinnerList.list[0].Name + " has won with the score of: " + WinnerList.list[0].Score + "!"; } HighScore.PickHighscoreList(); }
private void button2_Click_1(object sender, EventArgs e) { SaveGameSettings.GameType = 1; HighScore.CreateFolders(); HighScore.CheckHighscoreExsist(); currentScore.currentHscore = HighScore.ReadScoresFromFile(HighScore.Filename1); var sorted = from s in currentScore.currentHscore orderby s.Score descending select s; foreach (Player p in sorted) { SortedHighscoreList.Record(p); } HighscoreWindow hsw = new HighscoreWindow(); hsw.Text = "HighScore Combo"; hsw.ShowDialog(); SortedHighscoreList.list.Clear(); }