Beispiel #1
0
 public Deserializer(BSA_File _bsaFile)
 {
     bsaFile = _bsaFile;
     bsaFile.SortEntries();
     EntryCount = (bsaFile.BSA_Entries != null) ? int.Parse(bsaFile.BSA_Entries[bsaFile.BSA_Entries.Count() - 1].Index) + 1 : 0;
     Write();
 }
Beispiel #2
0
 public Deserializer(BSA_File _bsaFile, string location)
 {
     saveLocation = location;
     bsaFile      = _bsaFile;
     bsaFile.SortEntries();
     EntryCount = (bsaFile.BSA_Entries != null) ? int.Parse(bsaFile.BSA_Entries[bsaFile.BSA_Entries.Count() - 1].Index) + 1 : 0;
     Write();
     File.WriteAllBytes(saveLocation, bytes.ToArray());
 }
Beispiel #3
0
        public Deserializer(string location)
        {
            saveLocation = String.Format("{0}/{1}", Path.GetDirectoryName(location), Path.GetFileNameWithoutExtension(location));
            YAXSerializer serializer = new YAXSerializer(typeof(BSA_File), YAXSerializationOptions.DontSerializeNullObjects);

            bsaFile = (BSA_File)serializer.DeserializeFromFile(location);
            bsaFile.SortEntries();
            EntryCount = (bsaFile.BSA_Entries != null) ? int.Parse(bsaFile.BSA_Entries[bsaFile.BSA_Entries.Count() - 1].Index) + 1 : 0;
            Write();
            File.WriteAllBytes(saveLocation, bytes.ToArray());
        }