コード例 #1
0
 /// <summary>
 /// Gets the hash code for a given Matrix4.
 /// </summary>
 /// <returns>The calculated hash code.</returns>
 public override int GetHashCode()
 {
     // Note this method of hash code generation is similar to what the XNA framework does
     return(M11.GetHashCode() + M12.GetHashCode() + M13.GetHashCode() + M14.GetHashCode()
            + M21.GetHashCode() + M22.GetHashCode() + M23.GetHashCode() + M24.GetHashCode()
            + M31.GetHashCode() + M32.GetHashCode() + M33.GetHashCode() + M34.GetHashCode()
            + M41.GetHashCode() + M42.GetHashCode() + M43.GetHashCode() + M44.GetHashCode());
 }
コード例 #2
0
 public override int GetHashCode()
 {
     return(M11.GetHashCode()
            ^ M12.GetHashCode()
            ^ M13.GetHashCode()
            ^ M14.GetHashCode()
            ^ M21.GetHashCode()
            ^ M22.GetHashCode()
            ^ M23.GetHashCode()
            ^ M24.GetHashCode()
            ^ M31.GetHashCode()
            ^ M32.GetHashCode()
            ^ M33.GetHashCode()
            ^ M34.GetHashCode()
            ^ M41.GetHashCode()
            ^ M42.GetHashCode()
            ^ M43.GetHashCode()
            ^ M44.GetHashCode());
 }
コード例 #3
0
ファイル: Matrix.cs プロジェクト: hhinterview/SampSharp
 /// <summary>
 /// Returns a hash code for this instance.
 /// </summary>
 /// <returns>
 /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
 /// </returns>
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = M11.GetHashCode();
         hashCode = (hashCode * 397) ^ M12.GetHashCode();
         hashCode = (hashCode * 397) ^ M13.GetHashCode();
         hashCode = (hashCode * 397) ^ M14.GetHashCode();
         hashCode = (hashCode * 397) ^ M21.GetHashCode();
         hashCode = (hashCode * 397) ^ M22.GetHashCode();
         hashCode = (hashCode * 397) ^ M23.GetHashCode();
         hashCode = (hashCode * 397) ^ M24.GetHashCode();
         hashCode = (hashCode * 397) ^ M31.GetHashCode();
         hashCode = (hashCode * 397) ^ M32.GetHashCode();
         hashCode = (hashCode * 397) ^ M33.GetHashCode();
         hashCode = (hashCode * 397) ^ M34.GetHashCode();
         hashCode = (hashCode * 397) ^ M41.GetHashCode();
         hashCode = (hashCode * 397) ^ M42.GetHashCode();
         hashCode = (hashCode * 397) ^ M43.GetHashCode();
         hashCode = (hashCode * 397) ^ M44.GetHashCode();
         return(hashCode);
     }
 }
コード例 #4
0
 /// <inheritdoc/>
 public override Int32 GetHashCode()
 {
     unchecked
     {
         var hash = 17;
         hash = hash * 23 + M11.GetHashCode();
         hash = hash * 23 + M12.GetHashCode();
         hash = hash * 23 + M13.GetHashCode();
         hash = hash * 23 + M14.GetHashCode();
         hash = hash * 23 + M21.GetHashCode();
         hash = hash * 23 + M22.GetHashCode();
         hash = hash * 23 + M23.GetHashCode();
         hash = hash * 23 + M24.GetHashCode();
         hash = hash * 23 + M31.GetHashCode();
         hash = hash * 23 + M32.GetHashCode();
         hash = hash * 23 + M33.GetHashCode();
         hash = hash * 23 + M34.GetHashCode();
         hash = hash * 23 + M41.GetHashCode();
         hash = hash * 23 + M42.GetHashCode();
         hash = hash * 23 + M43.GetHashCode();
         hash = hash * 23 + M44.GetHashCode();
         return(hash);
     }
 }