Esempio n. 1
0
 public static void Load(TextReader reader)
 {
     try
     {
         XmlSerializer serializer = new XmlSerializer(typeof(SavedBuffSetList));
         AllSets = (SavedBuffSetList)serializer.Deserialize(reader);
         reader.Close();
     }
     catch { }
     finally
     {
         reader.Close();
         if (AllSets == null)
         {
             AllSets = new SavedBuffSetList();
         }
     }
 }
Esempio n. 2
0
 public static void Load(TextReader reader)
 {
     try
     {
         XmlSerializer serializer = new XmlSerializer(typeof(SavedBuffSetList));
         AllSets = (SavedBuffSetList)serializer.Deserialize(reader);
         reader.Close();
     }
     catch { }
     finally
     {
         reader.Close();
         if (AllSets == null)
         {
             AllSets = new SavedBuffSetList();
         }
         foreach (SavedBuffSet s in AllSets)
         {
             //if (s.SetAsString == null || s.SetAsString.Count <= 0) { s.SetAsString = s.GenSetAsString(); }
             if (s.SetAsString != null && s.SetAsString.Count > 0 && (s.BuffSet == null || s.BuffSet.Count <= 0))
             {
                 if (s.BuffSet == null)
                 {
                     s.BuffSet = new List <Buff>();
                 }
                 foreach (string b in s.SetAsString)
                 {
                     if (s.BuffSet.Contains(Buff.GetBuffByName(b)))
                     {
                         continue;
                     }                                                            // Don't add if it already has it
                     s.BuffSet.Add(Buff.GetBuffByName(b));
                 }
             }
         }
     }
 }