예제 #1
0
        public bool SaveHighScore(IHighScore Score)
        {
            var Scores = GetHighScores();

            var limittotop3 = true;
            int iteration   = 0;

            foreach (var RecordScore in Scores)
            {
                if (Score.Time < RecordScore.Time)
                {
                    break;
                }
                iteration += 1;
            }

            Scores.ToList().Insert(iteration, Score);


            string json = JsonConvert.SerializeObject(Scores);

            //write string to file
            System.IO.File.WriteAllText(path, json);

            return(true);
        }
 public void Add(IHighScore highScore)
 {
 }
예제 #3
0
 public PlayerScore(IHighScore highScore)
 {
     _highScore = highScore;
 }