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) { }
public PlayerScore(IHighScore highScore) { _highScore = highScore; }