Move suffix generation

This commit is contained in:
Matt Nadareski
2023-08-14 19:29:10 -04:00
parent 3b9ec1d62c
commit 242150d54c
4 changed files with 95 additions and 46 deletions

View File

@@ -572,31 +572,13 @@ namespace SabreTools.DatItems.Formats
/// Fill any missing size and hash information from another Rom
/// </summary>
/// <param name="other">Rom to fill information from</param>
public void FillMissingInformation(Rom other) => _rom?.FillMissingHashes(other?._rom);
public void FillMissingInformation(Rom other) => _rom.FillMissingHashes(other?._rom);
/// <summary>
/// Get unique duplicate suffix on name collision
/// </summary>
/// <returns>String representing the suffix</returns>
public string GetDuplicateSuffix()
{
if (!string.IsNullOrWhiteSpace(CRC))
return $"_{CRC}";
else if (!string.IsNullOrWhiteSpace(MD5))
return $"_{MD5}";
else if (!string.IsNullOrWhiteSpace(SHA1))
return $"_{SHA1}";
else if (!string.IsNullOrWhiteSpace(SHA256))
return $"_{SHA256}";
else if (!string.IsNullOrWhiteSpace(SHA384))
return $"_{SHA384}";
else if (!string.IsNullOrWhiteSpace(SHA512))
return $"_{SHA512}";
else if (!string.IsNullOrWhiteSpace(SpamSum))
return $"_{SpamSum}";
else
return "_1";
}
public string GetDuplicateSuffix() => _rom.GetDuplicateSuffix();
/// <summary>
/// Returns if the Rom contains any hashes