diff --git a/DBCD/DBCDStorage.cs b/DBCD/DBCDStorage.cs index df4c370..c8a9a3d 100644 --- a/DBCD/DBCDStorage.cs +++ b/DBCD/DBCDStorage.cs @@ -108,11 +108,12 @@ public interface IDBCDStorage : IEnumerable>, IDictiona DBCDRow ConstructRow(int index); + Dictionary GetEncryptedSections(); + Dictionary GetEncryptedIDs(); + void ApplyingHotfixes(HotfixReader hotfixReader); void ApplyingHotfixes(HotfixReader hotfixReader, HotfixReader.RowProcessor processor); - Dictionary GetEncryptedSections(); - void Save(string filename); Dictionary ToDictionary(); @@ -145,15 +146,6 @@ public DBCDStorage(DBParser parser, Storage storage, DBCDInfo info) : base(ne storage.Clear(); } - IEnumerator> IEnumerable>.GetEnumerator() - { - var enumerator = GetEnumerator(); - while (enumerator.MoveNext()) - yield return new DynamicKeyValuePair(enumerator.Current.Key, enumerator.Current.Value); - } - - public Dictionary GetEncryptedSections() => this.parser.GetEncryptedSections(); - public void ApplyingHotfixes(HotfixReader hotfixReader) { this.ApplyingHotfixes(hotfixReader, null); @@ -166,7 +158,7 @@ public void ApplyingHotfixes(HotfixReader hotfixReader, HotfixReader.RowProcesso hotfixReader.ApplyHotfixes(mutableStorage, this.parser, processor); #if NETSTANDARD2_0 - foreach(var record in mutableStorage) + foreach (var record in mutableStorage) base[record.Key] = new DBCDRow(record.Key, record.Value, fieldAccessor); #else foreach (var (id, row) in mutableStorage) @@ -176,6 +168,16 @@ public void ApplyingHotfixes(HotfixReader hotfixReader, HotfixReader.RowProcesso base.Remove(key); } + IEnumerator> IEnumerable>.GetEnumerator() + { + var enumerator = GetEnumerator(); + while (enumerator.MoveNext()) + yield return new DynamicKeyValuePair(enumerator.Current.Key, enumerator.Current.Value); + } + + public Dictionary GetEncryptedSections() => this.parser.GetEncryptedSections(); + public Dictionary GetEncryptedIDs() => this.parser.GetEncryptedIDs(); + public void Save(string filename) { #if NETSTANDARD2_0 @@ -186,8 +188,6 @@ public void Save(string filename) foreach (var (id, record) in new SortedDictionary(this)) storage.Add(id, record.AsType()); #endif - - storage?.Save(filename); }