Cell - implement == and != overrides, this might fix some subtle problems in input roll

This commit is contained in:
adelikat 2019-10-26 17:22:49 -05:00
parent 6604e5dc17
commit 9d87550c2a
1 changed files with 16 additions and 1 deletions

View File

@ -29,13 +29,28 @@ namespace BizHawk.Client.EmuHawk
return Column == cell.Column && RowIndex == cell.RowIndex;
}
return base.Equals(obj);
return false;
}
public override int GetHashCode()
{
return Column.GetHashCode() + RowIndex.GetHashCode();
}
public static bool operator ==(Cell a, Cell b)
{
if (ReferenceEquals(a, null))
{
return ReferenceEquals(b, null);
}
return a.Equals(b);
}
public static bool operator !=(Cell a, Cell b)
{
return !(a == b);
}
}
internal class SortCell : IComparer<Cell>