mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Cleanup and overhaul (#21)
* Syntax cleanup * More minor cleanup, use Linq * Fix broken features by using correct values * Feature flags the same * Features are modular * No AlphaFS, more .NET versions * Fix appveyor * Put back identifiers, for some reason * String interpolation, modernization * Better use of GetField * XmlTextWriter to remove possible issues * Fix header for OpenMSX
This commit is contained in:
@@ -136,11 +136,11 @@ namespace SabreTools.Library.DatItems
|
||||
/// </summary>
|
||||
public Rom()
|
||||
{
|
||||
this.Name = "";
|
||||
this.Name = string.Empty;
|
||||
this.ItemType = ItemType.Rom;
|
||||
this.DupeType = 0x00;
|
||||
this.ItemStatus = ItemStatus.None;
|
||||
this.Date = "";
|
||||
this.Date = string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -155,34 +155,28 @@ namespace SabreTools.Library.DatItems
|
||||
this.Name = name;
|
||||
this.ItemType = ItemType.Rom;
|
||||
this.Size = -1;
|
||||
|
||||
if ((omitFromScan & Hash.CRC) == 0)
|
||||
{
|
||||
_crc = null;
|
||||
}
|
||||
|
||||
if ((omitFromScan & Hash.MD5) == 0)
|
||||
{
|
||||
_md5 = null;
|
||||
}
|
||||
|
||||
if ((omitFromScan & Hash.RIPEMD160) == 0)
|
||||
{
|
||||
_ripemd160 = null;
|
||||
}
|
||||
|
||||
if ((omitFromScan & Hash.SHA1) == 0)
|
||||
{
|
||||
_sha1 = null;
|
||||
}
|
||||
|
||||
if ((omitFromScan & Hash.SHA256) == 0)
|
||||
{
|
||||
_sha256 = null;
|
||||
}
|
||||
|
||||
if ((omitFromScan & Hash.SHA384) == 0)
|
||||
{
|
||||
_sha384 = null;
|
||||
}
|
||||
|
||||
if ((omitFromScan & Hash.SHA512) == 0)
|
||||
{
|
||||
_sha512 = null;
|
||||
}
|
||||
|
||||
this.ItemStatus = ItemStatus.None;
|
||||
|
||||
_machine = new Machine
|
||||
@@ -278,12 +272,10 @@ namespace SabreTools.Library.DatItems
|
||||
|
||||
// If we don't have a rom, return false
|
||||
if (this.ItemType != other.ItemType)
|
||||
{
|
||||
return dupefound;
|
||||
}
|
||||
|
||||
// Otherwise, treat it as a rom
|
||||
Rom newOther = (Rom)other;
|
||||
// Otherwise, treat it as a Rom
|
||||
Rom newOther = other as Rom;
|
||||
|
||||
// If all hashes are empty but they're both nodump and the names match, then they're dupes
|
||||
if ((this.ItemStatus == ItemStatus.Nodump && newOther.ItemStatus == ItemStatus.Nodump)
|
||||
|
||||
Reference in New Issue
Block a user