Example #1
0
 /// <summary>
 /// A custom hash code algorithm that takes into account the values of each property of the <see cref="SpawnInfo"/> instance,
 /// and attempts to reduce diagonal collisions.
 /// </summary>
 /// <returns>A 32-bit signed integer that is the hash code for this instance.</returns>
 public override int GetHashCode()
 {
     unchecked // overflow is fine, just wrap around
     {
         int hash = 13;
         hash = (hash * 7) + TechType.GetHashCode();
         hash = (hash * 7) + ClassId.GetHashCode();
         hash = (hash * 7) + SpawnPosition.GetHashCode();
         hash = (hash * 7) + Rotation.GetHashCode();
         hash = (hash * 7) + Type.GetHashCode();
         return(hash);
     }
 }