[Structs] Make RomData comparable

This commit is contained in:
Matt Nadareski
2016-06-16 10:48:12 -07:00
parent 1894b0cfc0
commit d58b67f124

View File

@@ -30,16 +30,24 @@ namespace SabreTools.Helper
try try
{ {
RomData comp = (RomData)obj; RomData comp = (RomData)obj;
if (this.Game == comp.Game &&
this.Name == comp.Name && if (this.SystemID == comp.SystemID)
RomTools.IsDuplicate(this, comp))
{ {
return 0; if (this.SourceID == comp.SourceID)
} {
else if (this.Game == comp.Game)
{ {
return 1; if (this.Name == comp.Name)
{
return (RomTools.IsDuplicate(this, comp) ? 0 : 1);
}
return String.Compare(this.Name, comp.Name);
}
return String.Compare(this.Game, comp.Game);
}
return this.SourceID - comp.SourceID;
} }
return this.SystemID - comp.SystemID;
} }
catch catch
{ {