示例#1
0
        public static SavedTalentSpecList SpecsFor(CharacterClass charClass)
        {
            SavedTalentSpecList ret = new SavedTalentSpecList();

            foreach (SavedTalentSpec sts in AllSpecs)
            {
                if (sts.Class == charClass)
                {
                    ret.Add(sts);
                }
            }
            return(ret);
        }
示例#2
0
 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();
         }
     }
 }
示例#3
0
 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);
     }
 }