From 91c25d7b84f8164f2c00c002accc499070e3c8f5 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 16 Jan 2016 10:55:13 +0000 Subject: [PATCH] Remove unused Package.(Classic|Crc)Hashes. --- OpenRA.Game/FileSystem/BagFile.cs | 12 ------------ OpenRA.Game/FileSystem/BigFile.cs | 10 ---------- OpenRA.Game/FileSystem/D2kSoundResources.cs | 10 ---------- OpenRA.Game/FileSystem/Folder.cs | 11 ----------- OpenRA.Game/FileSystem/IPackage.cs | 2 -- .../FileSystem/InstallShieldCABExtractor.cs | 10 ---------- OpenRA.Game/FileSystem/InstallShieldPackage.cs | 15 --------------- OpenRA.Game/FileSystem/MixFile.cs | 17 ----------------- OpenRA.Game/FileSystem/Pak.cs | 11 ----------- OpenRA.Game/FileSystem/ZipFile.cs | 11 ----------- 10 files changed, 109 deletions(-) diff --git a/OpenRA.Game/FileSystem/BagFile.cs b/OpenRA.Game/FileSystem/BagFile.cs index 2c24d232ac..341435230d 100644 --- a/OpenRA.Game/FileSystem/BagFile.cs +++ b/OpenRA.Game/FileSystem/BagFile.cs @@ -21,8 +21,6 @@ namespace OpenRA.FileSystem { public sealed class BagFile : IReadOnlyPackage { - static readonly uint[] Nothing = { }; - readonly string bagFilename; readonly Stream s; readonly int bagFilePriority; @@ -148,16 +146,6 @@ namespace OpenRA.FileSystem return FindMatchingHash(filename).HasValue; } - public IEnumerable ClassicHashes() - { - return Nothing; - } - - public IEnumerable CrcHashes() - { - return index.Keys; - } - public IEnumerable AllFileNames() { var lookup = new Dictionary(); diff --git a/OpenRA.Game/FileSystem/BigFile.cs b/OpenRA.Game/FileSystem/BigFile.cs index 8d8dc559ef..8bb6b69025 100644 --- a/OpenRA.Game/FileSystem/BigFile.cs +++ b/OpenRA.Game/FileSystem/BigFile.cs @@ -96,16 +96,6 @@ namespace OpenRA.FileSystem return entries.ContainsKey(filename); } - public IEnumerable ClassicHashes() - { - return entries.Keys.Select(filename => PackageEntry.HashFilename(filename, PackageHashType.Classic)); - } - - public IEnumerable CrcHashes() - { - return Enumerable.Empty(); - } - public IEnumerable AllFileNames() { return entries.Keys; diff --git a/OpenRA.Game/FileSystem/D2kSoundResources.cs b/OpenRA.Game/FileSystem/D2kSoundResources.cs index b587df77c9..001502c13d 100644 --- a/OpenRA.Game/FileSystem/D2kSoundResources.cs +++ b/OpenRA.Game/FileSystem/D2kSoundResources.cs @@ -83,16 +83,6 @@ namespace OpenRA.FileSystem public int Priority { get { return 1000 + priority; } } - public IEnumerable ClassicHashes() - { - return index.Keys; - } - - public IEnumerable CrcHashes() - { - yield break; - } - public void Dispose() { s.Dispose(); diff --git a/OpenRA.Game/FileSystem/Folder.cs b/OpenRA.Game/FileSystem/Folder.cs index 5fe419b2f9..1fcef789d9 100644 --- a/OpenRA.Game/FileSystem/Folder.cs +++ b/OpenRA.Game/FileSystem/Folder.cs @@ -43,17 +43,6 @@ namespace OpenRA.FileSystem catch { return null; } } - public IEnumerable ClassicHashes() - { - foreach (var filename in Directory.GetFiles(path, "*", SearchOption.TopDirectoryOnly)) - yield return PackageEntry.HashFilename(Path.GetFileName(filename), PackageHashType.Classic); - } - - public IEnumerable CrcHashes() - { - yield break; - } - public IEnumerable AllFileNames() { foreach (var filename in Directory.GetFiles(path, "*", SearchOption.TopDirectoryOnly)) diff --git a/OpenRA.Game/FileSystem/IPackage.cs b/OpenRA.Game/FileSystem/IPackage.cs index e336b0602e..cb9c54d1c5 100644 --- a/OpenRA.Game/FileSystem/IPackage.cs +++ b/OpenRA.Game/FileSystem/IPackage.cs @@ -18,8 +18,6 @@ namespace OpenRA.FileSystem { Stream GetContent(string filename); bool Exists(string filename); - IEnumerable ClassicHashes(); - IEnumerable CrcHashes(); IEnumerable AllFileNames(); int Priority { get; } string Name { get; } diff --git a/OpenRA.Game/FileSystem/InstallShieldCABExtractor.cs b/OpenRA.Game/FileSystem/InstallShieldCABExtractor.cs index 618810ada4..17756bd979 100644 --- a/OpenRA.Game/FileSystem/InstallShieldCABExtractor.cs +++ b/OpenRA.Game/FileSystem/InstallShieldCABExtractor.cs @@ -451,11 +451,6 @@ namespace OpenRA.FileSystem GetContentById(index, destfile); } - public IEnumerable ClassicHashes() - { - return fileLookup.Keys.Select(k => PackageEntry.HashFilename(k, PackageHashType.Classic)); - } - public Stream GetContentById(uint index) { var fileDes = fileDescriptors[index]; @@ -507,11 +502,6 @@ namespace OpenRA.FileSystem return GetContentById(fileLookup[fileName]); } - public IEnumerable CrcHashes() - { - yield break; - } - public IEnumerable AllFileNames() { return fileLookup.Keys; diff --git a/OpenRA.Game/FileSystem/InstallShieldPackage.cs b/OpenRA.Game/FileSystem/InstallShieldPackage.cs index dd28d1042d..9e619609c6 100644 --- a/OpenRA.Game/FileSystem/InstallShieldPackage.cs +++ b/OpenRA.Game/FileSystem/InstallShieldPackage.cs @@ -122,16 +122,6 @@ namespace OpenRA.FileSystem return GetContent(PackageEntry.HashFilename(filename, PackageHashType.Classic)); } - public IEnumerable ClassicHashes() - { - return index.Keys; - } - - public IEnumerable CrcHashes() - { - yield break; - } - public IEnumerable AllFileNames() { return filenames; @@ -145,11 +135,6 @@ namespace OpenRA.FileSystem public int Priority { get { return 2000 + priority; } } public string Name { get { return filename; } } - public void Write(Dictionary contents) - { - throw new NotImplementedException("Cannot save InstallShieldPackages."); - } - public void Dispose() { s.Dispose(); diff --git a/OpenRA.Game/FileSystem/MixFile.cs b/OpenRA.Game/FileSystem/MixFile.cs index 25532a8ff5..66914b2c54 100644 --- a/OpenRA.Game/FileSystem/MixFile.cs +++ b/OpenRA.Game/FileSystem/MixFile.cs @@ -170,23 +170,6 @@ namespace OpenRA.FileSystem return hash.HasValue ? GetContent(hash.Value) : null; } - static readonly uint[] Nothing = { }; - public IEnumerable ClassicHashes() - { - if (type == PackageHashType.Classic) - return index.Keys; - - return Nothing; - } - - public IEnumerable CrcHashes() - { - if (type == PackageHashType.CRC32) - return index.Keys; - - return Nothing; - } - public IEnumerable AllFileNames() { var lookup = new Dictionary(); diff --git a/OpenRA.Game/FileSystem/Pak.cs b/OpenRA.Game/FileSystem/Pak.cs index e7fc40023e..6ac57a7ae4 100644 --- a/OpenRA.Game/FileSystem/Pak.cs +++ b/OpenRA.Game/FileSystem/Pak.cs @@ -70,17 +70,6 @@ namespace OpenRA.FileSystem return new MemoryStream(data); } - public IEnumerable ClassicHashes() - { - foreach (var filename in index.Keys) - yield return PackageEntry.HashFilename(filename, PackageHashType.Classic); - } - - public IEnumerable CrcHashes() - { - yield break; - } - public IEnumerable AllFileNames() { foreach (var filename in index.Keys) diff --git a/OpenRA.Game/FileSystem/ZipFile.cs b/OpenRA.Game/FileSystem/ZipFile.cs index f376e23e68..03e25ce0f5 100644 --- a/OpenRA.Game/FileSystem/ZipFile.cs +++ b/OpenRA.Game/FileSystem/ZipFile.cs @@ -71,17 +71,6 @@ namespace OpenRA.FileSystem } } - public IEnumerable ClassicHashes() - { - foreach (ZipEntry entry in pkg) - yield return PackageEntry.HashFilename(entry.Name, PackageHashType.Classic); - } - - public IEnumerable CrcHashes() - { - yield break; - } - public IEnumerable AllFileNames() { foreach (ZipEntry entry in pkg)