public ScoreList TrimList(String MapName, GameDifficulty Difficulty) { ScoreList Trimed = new ScoreList(); foreach(ScoreEntry Entry in ScoreEntries) { if (Entry.MapName == MapName && Entry.Difficulty == Difficulty) { Trimed.ScoreEntries.Add(Entry); } } return Trimed; }
public static ScoreList LoadScoreList(String Path) { ScoreList List = new ScoreList(); XmlSerializer Xs = new XmlSerializer(typeof(ScoreList)); if (File.Exists(Path)) { TextReader reader = new StreamReader(Path); List = (ScoreList)Xs.Deserialize(reader); reader.Close(); } return List; }
public static void SaveScoreList(ScoreList List, String Path) { XmlSerializer Xs = new XmlSerializer(typeof(ScoreList)); TextWriter writer = new StreamWriter(Path); Xs.Serialize(writer, List); writer.Close(); }