public static SavedTalentSpecList SpecsFor(CharacterClass charClass) { SavedTalentSpecList ret = new SavedTalentSpecList(); foreach (SavedTalentSpec sts in AllSpecs) { if (sts.Class == charClass) { ret.Add(sts); } } return(ret); }
public static void Load(TextReader reader) { try { XmlSerializer serializer = new XmlSerializer(typeof(SavedTalentSpecList)); AllSpecs = (SavedTalentSpecList)serializer.Deserialize(reader); reader.Close(); } catch { } finally { reader.Close(); if (AllSpecs == null) { AllSpecs = new SavedTalentSpecList(); } } }
private void LoadTalentSpecs() { try { if (File.Exists(SavedFilePath)) { using (StreamReader reader = new StreamReader(SavedFilePath, Encoding.UTF8)) { XmlSerializer serializer = new XmlSerializer(typeof(SavedTalentSpecList)); _savedTalents = (SavedTalentSpecList)serializer.Deserialize(reader); reader.Close(); } } } catch (Exception) { ; } if (_savedTalents == null) { _savedTalents = new SavedTalentSpecList(10); } }