예제 #1
0
파일: HighScoreTests.cs 프로젝트: T145/2N
        public void Test_Save_Load()
        {
            HightScoreCollection NewScore = new HightScoreCollection();

            NewScore.Save(HightScoreCollection.HighScores);
            List <string> result  = NewScore.Load();
            string        results = result[0];

            Assert.IsFalse(results == "1 Dorcas 456735");
        }
예제 #2
0
        //Generates the highscore screen.
        public void Generate_HighScoreScreen()
        {
            List <string> HighScoreData = HightScoreCollection.Load();


            int Rank = 1;

            foreach (string line in HighScoreData)
            {
                string[] values = line.Split(' ');
                Ranks.Children.Add(new Label {
                    Text = Rank.ToString()
                });
                Names.Children.Add(new Label {
                    Text = values[0]
                });
                Score.Children.Add(new Label {
                    Text = values[1]
                });
            }

            ++Rank;
        }