示例#1
0
        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();
        }
示例#2
0
        public static void SortPlayer()
        {
            // Sorts the PlayerList and saves the result in WinnerList, ordered by score from high to low.
            var winner = from w in PlayerList.list
                         orderby w.Score descending
                         select w;

            foreach (Player p in winner)
            {
                WinnerList.Record(p);
            }

            if (SaveGameSettings.GameType == 0)
            {
                currentScore.currentHscore = HighScore.ReadScoresFromFile(Filename);
            }

            else if (SaveGameSettings.GameType == 1)
            {
                currentScore.currentHscore = HighScore.ReadScoresFromFile(Filename1);
            }

            var winners = from w in currentScore.currentHscore
                          orderby w.Score descending
                          select w;

            foreach (Player p in winners)
            {
                HighscoreList.Record(p);
            }

            foreach (Player p in winner)
            {
                HighscoreList.Record(p);
            }
        }