Esempio n. 1
0
 /// <summary>
 /// Gets the hash code for this object which can help for quick checks of equality
 /// or when inserting this Cell into a hash-based collection such as a Dictionary or Hashtable
 /// </summary>
 /// <returns>An integer hash used to identify this Cell</returns>
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = X;
         hashCode = (hashCode * 397) ^ Y;
         hashCode = (hashCode * 397) ^ IsTransparent.GetHashCode();
         hashCode = (hashCode * 397) ^ IsWalkable.GetHashCode();
         return(hashCode);
     }
 }
Esempio n. 2
0
 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);
     }
 }