public override int GetHashCode() { unchecked { var hashCode = 33 + Body.GetHashCode(); hashCode = (hashCode * 397) ^ Declaration.GetHashCode(); hashCode = (hashCode * 397) ^ LoopedReference.GetHashCode(); return(hashCode); } }
public override int GetHashCode() { unchecked { var hashCode = (Name != null ? Name.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Declaration != null ? Declaration.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Method != null ? Method.GetHashCode() : 0); hashCode = (hashCode * 397) ^ IsAssemblyReference.GetHashCode(); return(hashCode); } }
/// <summary> /// Initializes a new instance of the <see cref="VertexBufferBinding"/> struct. /// </summary> /// <param name="vertexBuffer">The buffer containing the vertices.</param> /// <param name="vertexDeclaration">A <see cref="VertexDeclaration"/> specifying tha layout of the vertices.</param> /// <param name="vertexCount">The number of vertices.</param> /// <param name="vertexStride"> /// Number of bytes to advance to get to the next vertex. /// If -1, it gets auto-discovered from the <paramref name="vertexDeclaration"/>. /// </param> /// <param name="vertexOffset"> /// Offset (in Vertex ElementCount) from the beginning of the buffer to the first vertex to use. /// </param> public VertexBufferBinding(Buffer vertexBuffer, VertexDeclaration vertexDeclaration, int vertexCount, int vertexStride = -1, int vertexOffset = 0) : this() { Buffer = vertexBuffer ?? throw new ArgumentNullException(nameof(vertexBuffer)); Declaration = vertexDeclaration ?? throw new ArgumentNullException(nameof(vertexDeclaration)); Stride = vertexStride != -1 ? vertexStride : vertexDeclaration.VertexStride; Offset = vertexOffset; Count = vertexCount; HashCode hash = default; hash.Add(Buffer.GetHashCode()); hash.Add(Offset); hash.Add(Stride); hash.Add(Count); hash.Add(Declaration.GetHashCode()); hashCode = hash.ToHashCode(); }
public override int GetHashCode() => Declaration.GetHashCode();