public ScoreEntry GetHighestScore() { ScoreEntry Score = new ScoreEntry(); int Highest = 0; int Index = -1; for (int i = 0; i < ScoreEntries.Count; i++) { if (ScoreEntries[i].Score > Highest) { Highest = ScoreEntries[i].Score; Index = i; } } if (Index != -1) { Score = ScoreEntries[Index]; } return Score; }
public void SaveScore(String PlayerName) { ScoreEntry Entry = new ScoreEntry(PlayerName, Score, Wave - 1, Difficulty, map.MapName); ScoreList HighscoreList = ScoreList.LoadScoreList("../../../../assets/GameData/ScoreHistory.xml"); HighscoreList.ScoreEntries.Add(Entry); ScoreList.SaveScoreList(HighscoreList, "../../../../assets/GameData/ScoreHistory.xml"); MapTop10 = HighscoreList.TrimList(map.MapName, Difficulty); MapTop10.KeepTop10(); }