public override int GetHashCode() { unchecked { var hashCode = Point.X; hashCode = (hashCode * 397) ^ Point.Y; hashCode = (hashCode * 397) ^ IsTransparent.GetHashCode(); hashCode = (hashCode * 397) ^ IsWalkable.GetHashCode(); hashCode = (hashCode * 397) ^ IsInFov.GetHashCode(); hashCode = (hashCode * 397) ^ IsExplored.GetHashCode(); return(hashCode); } }
/// <summary> /// Determines whether two Cell instances are equal /// </summary> /// <param name="other">The Cell to compare this instance to</param> /// <returns>True if the instances are equal; False otherwise</returns> /// <exception cref="NullReferenceException">Thrown if .Equals is invoked on null Cell</exception> protected bool Equals(Cell other) { if (other == null) { return(false); } return(X == other.X && Y == other.Y && IsTransparent.Equals(other.IsTransparent) && IsWalkable.Equals(other.IsWalkable) && IsInFov.Equals(other.IsInFov) && IsExplored.Equals(other.IsExplored)); }