From 2ad3fe8fd6fab66541129d9287c1271cdfb5137e Mon Sep 17 00:00:00 2001 From: Kurt Date: Sat, 19 Sep 2020 10:23:21 -0700 Subject: [PATCH] Remove unnecessary value set --- NHSE.Core/Hashing/FileHashInfo.cs | 5 +---- NHSE.Core/Hashing/FileHashRevision.cs | 15 +++++---------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/NHSE.Core/Hashing/FileHashInfo.cs b/NHSE.Core/Hashing/FileHashInfo.cs index 208e0e9..089b0aa 100644 --- a/NHSE.Core/Hashing/FileHashInfo.cs +++ b/NHSE.Core/Hashing/FileHashInfo.cs @@ -7,11 +7,8 @@ namespace NHSE.Core public sealed class FileHashInfo : Dictionary #pragma warning restore CA2237 // Mark ISerializable types with serializable { - public readonly uint RevisionId; // Custom to us - - public FileHashInfo(uint revisionId, FileHashDetails[] hashSets) + public FileHashInfo(IEnumerable hashSets) { - RevisionId = revisionId; foreach (var hashSet in hashSets) this[hashSet.FileSize] = hashSet; } diff --git a/NHSE.Core/Hashing/FileHashRevision.cs b/NHSE.Core/Hashing/FileHashRevision.cs index ed6d321..2ffb356 100644 --- a/NHSE.Core/Hashing/FileHashRevision.cs +++ b/NHSE.Core/Hashing/FileHashRevision.cs @@ -7,14 +7,13 @@ public static class FileHashRevision { #region REVISION 1.0.0 - private const uint REVISION_100_ID = 0; private const int MAIN_SAVE_SIZE = 0xAC0938; private const int PERSONAL_SAVE_SIZE = 0x6BC50; private const int POSTBOX_SAVE_SIZE = 0xB44580; private const int PHOTO_STUDIO_ISLAND_SIZE = 0x263B4; private const int PROFILE_SIZE = 0x69508; - public static readonly FileHashInfo REV_100 = new FileHashInfo(REVISION_100_ID, new[] + public static readonly FileHashInfo REV_100 = new FileHashInfo(new[] { new FileHashDetails("main.dat", MAIN_SAVE_SIZE, new[] { @@ -61,14 +60,13 @@ public static class FileHashRevision #region REVISION 1.1.0 - private const uint REVISION_110_ID = 1; private const int REV_110_MAIN_SAVE_SIZE = 0xAC2AA0; private const int REV_110_PERSONAL_SAVE_SIZE = 0x6BED0; private const int REV_110_POSTBOX_SAVE_SIZE = 0xB44590; private const int REV_110_PHOTO_STUDIO_ISLAND_SIZE = 0x263C0; private const int REV_110_PROFILE_SIZE = 0x69560; - public static readonly FileHashInfo REV_110 = new FileHashInfo(REVISION_110_ID, new[] + public static readonly FileHashInfo REV_110 = new FileHashInfo(new[] { new FileHashDetails("main.dat", REV_110_MAIN_SAVE_SIZE, new[] { @@ -115,14 +113,13 @@ public static class FileHashRevision #region REVISION 1.2.0 - private const uint REVISION_120_ID = 2; private const int REV_120_MAIN_SAVE_SIZE = 0xACECD0; private const int REV_120_PERSONAL_SAVE_SIZE = 0x6D6C0; private const int REV_120_POSTBOX_SAVE_SIZE = REV_110_POSTBOX_SAVE_SIZE; private const int REV_120_PHOTO_STUDIO_ISLAND_SIZE = 0x2C9C0; private const int REV_120_PROFILE_SIZE = REV_110_PROFILE_SIZE; - public static readonly FileHashInfo REV_120 = new FileHashInfo(REVISION_120_ID, new[] + public static readonly FileHashInfo REV_120 = new FileHashInfo(new[] { new FileHashDetails("main.dat", REV_120_MAIN_SAVE_SIZE, new[] { @@ -169,14 +166,13 @@ public static class FileHashRevision #region REVISION 1.3.0 - private const uint REVISION_130_ID = 3; private const int REV_130_MAIN_SAVE_SIZE = 0xACED80; private const int REV_130_PERSONAL_SAVE_SIZE = 0x6D6D0; private const int REV_130_POSTBOX_SAVE_SIZE = REV_110_POSTBOX_SAVE_SIZE; private const int REV_130_PHOTO_STUDIO_ISLAND_SIZE = REV_120_PHOTO_STUDIO_ISLAND_SIZE; private const int REV_130_PROFILE_SIZE = REV_110_PROFILE_SIZE; - public static readonly FileHashInfo REV_130 = new FileHashInfo(REVISION_130_ID, new[] + public static readonly FileHashInfo REV_130 = new FileHashInfo(new[] { new FileHashDetails("main.dat", REV_130_MAIN_SAVE_SIZE, new[] { @@ -223,14 +219,13 @@ public static class FileHashRevision #region REVISION 1.4.0 - private const uint REVISION_140_ID = 4; private const int REV_140_MAIN_SAVE_SIZE = 0xB05790; private const int REV_140_PERSONAL_SAVE_SIZE = 0x74420; private const int REV_140_POSTBOX_SAVE_SIZE = REV_110_POSTBOX_SAVE_SIZE; private const int REV_140_PHOTO_STUDIO_ISLAND_SIZE = REV_120_PHOTO_STUDIO_ISLAND_SIZE; private const int REV_140_PROFILE_SIZE = REV_110_PROFILE_SIZE; - public static readonly FileHashInfo REV_140 = new FileHashInfo(REVISION_140_ID, new[] + public static readonly FileHashInfo REV_140 = new FileHashInfo(new[] { new FileHashDetails("main.dat", REV_140_MAIN_SAVE_SIZE, new[] {