[Structs] Make RomData comparable

This commit is contained in:
Matt Nadareski
2016-06-16 10:42:35 -07:00
parent 0fb85d86b6
commit 1894b0cfc0

View File

@@ -6,7 +6,7 @@ namespace SabreTools.Helper
/// <summary>
/// Intermediate struct for holding and processing rom data
/// </summary>
public struct RomData
public struct RomData : IComparable
{
public string Manufacturer;
public string System;
@@ -24,6 +24,28 @@ namespace SabreTools.Helper
public DupeType Dupe;
public bool Nodump;
public string Date;
public int CompareTo(object obj)
{
try
{
RomData comp = (RomData)obj;
if (this.Game == comp.Game &&
this.Name == comp.Name &&
RomTools.IsDuplicate(this, comp))
{
return 0;
}
else
{
return 1;
}
}
catch
{
return 1;
}
}
}
/// <summary>