Exemplo n.º 1
0
 public static void LoadLoreDatas()
 {
     LoreDatas.Clear();
     if (DebugMode)
     {
         return;
     }
     if (File.Exists(ClassLoreDataSaveFileName))
     {
         using (FileStream stream = new FileStream(ClassLoreDataSaveFileName, FileMode.Open))
         {
             using (BinaryReader reader = new BinaryReader(stream))
             {
                 int LastModVersion = reader.ReadInt32();
                 int DataCounts     = reader.ReadInt32();
                 for (int d = 0; d < DataCounts; d++)
                 {
                     int    ClassID               = reader.ReadInt32();
                     string ClassModID            = reader.ReadString();
                     ClassUnlockLoreData loredata = new ClassUnlockLoreData(ClassID, ClassModID);
                     loredata.Load(reader, LastModVersion);
                     LoreDatas.Add(loredata);
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
        public static ClassUnlockLoreData GetClassLoreData(int ID, string ModID = "")
        {
            if (ModID == "")
            {
                ModID = mod.Name;
            }
            foreach (ClassUnlockLoreData ld in LoreDatas)
            {
                if (ld.ClassID == ID && ld.ClassModID == ModID)
                {
                    return(ld);
                }
            }
            ClassUnlockLoreData nld = new ClassUnlockLoreData(ID, ModID);

            LoreDatas.Add(nld);
            return(nld);
        }