void LoadSavedScores() { highScores = new List <ScoreDisplay>(); List <Score> scores = SaveDataManager.CopyCurrentDataSave().GetHighScores(); scores.ForEach(score => highScores.Add(new ScoreDisplay(score))); SortScores(); }
public void AddHighScore(ScoreDisplay newScore) { SortScores(); highScores.ForEach(score => score.MarkAsOldScore()); newScore.MarkAsNewScore(); highScores.RemoveAt(maxHighScores - 1); highScores.Add(newScore); SortScores(); SaveDataManager.Save(new DataSave(GetAsScores())); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); ScreenManager.Instance.LoadContent(Content); AudioManager.Instance.LoadContent(Content); SaveDataManager.LoadContent(Content); BackGroundPulseManager.Instance.LoadContent(Content); LoadScores(); HighScoreDisplay.Instance.OnGameOpen(); LoadTitleScreen(); }