can someone explain me why I do get different results?
bool result = true;
for (int row = 0; row < State.Rows; row++)
{
for (int col = 0; col < State.Cols; col++)
{
if (map[row][col] != other.map[row][col])
//if (!map[row][col].Equals(other.map[row][col]))
result = false;
}
}
bool sequenceEqual = map.SequenceEqual(other.map);
//result = true
//sequenceEqual = false
I overwrote Equals()
, GetHashCode()
, ==
and !=
for the type to be compared. I also tried the CollectionComparer
from this answer, and got the same result.