Ejemplo n.º 1
0
        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");
        }
Ejemplo n.º 2
0
        private void MoveRight(object sender, EventArgs e)
        {
            MoveTiles(Model.ShiftTiles(Direction.Right));
            ScoreLabel.Text = Convert.ToString(Scores.GetScore());

            RotatePieces();
            if (Model.GameOver)
            {
                HighScore.CheckIfHighScore(Name.Text, Scores.Score);
                HightScoreCollection.Save();
                App.Current.MainPage = new HighScoreScreen();
            }
        }
Ejemplo n.º 3
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;
        }
Ejemplo n.º 4
0
 private void Highestscores_Clicked(object sender, EventArgs e)
 {
     HighScore.CheckIfHighScore(Name.Text, Scores.Score);
     HightScoreCollection.Save();
     App.Current.MainPage = new HighScoreScreen();
 }