/// <summary> /// Compares two ROMs using the specified compare implementation. /// </summary> /// <param name="rom">The 'reference' ROM to compare against.</param> /// <param name="otherRom">The ROM to compare to <paramref name="rom"/>.</param> /// <param name="otherProgramInfo">Pre-fetched program information, which may make certain comparisons slightly faster.</param> /// <param name="comparer">The comparison implementation to use.</param> /// <returns><c>true</c> if <paramref name="rom"/> and <paramref name="otherRom"/> are considered equal using <paramref name="comparer"/>.</returns> public static bool IsEquivalentTo(this IRom rom, IRom otherRom, IProgramInformation otherProgramInfo, RomComparer comparer) { var result = comparer.Compare(rom, null, otherRom, otherProgramInfo); var equivalent = result == 0; return(equivalent); }
/// <inheritdoc /> public override int Compare(IRom x, IProgramInformation programInformationX, IRom y, IProgramInformation programInformationY) { var result = BaseComparer.Compare(x, programInformationX, y, programInformationY); if (result != 0) { result = CanonicalCompare(x, y, true); // require features to match as well } return(result); }
/// <inheritdoc /> public override int Compare(IRom x, IProgramInformation programInformationRomX, IRom y, IProgramInformation programInformationRomY) { var result = BaseComparer.Compare(x, programInformationRomX, y, programInformationRomY); if (result != 0) { result = CanonicalCompare(x, y, false); } return(result); }