/// Defines a 2d box (rectangle).
/// </summary>
[StructLayout(LayoutKind.Sequential)]
- public struct Box2
+ public struct Box2 : IEquatable<Box2>
{
/// <summary>
/// The left boundary of the structure.
return obj is Box2 && Equals((Box2) obj);
}
- /// <summary>
- /// Gets the hash code for this Box2.
- /// </summary>
- /// <returns></returns>
+ ///// <summary>
+ ///// Gets the hash code for this Box2.
+ ///// </summary>
public override int GetHashCode()
{
- return Left.GetHashCode() ^ Right.GetHashCode() ^ Top.GetHashCode() ^ Bottom.GetHashCode();
+ unchecked
+ {
+ var hashCode = this.Left.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Right.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Top.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Bottom.GetHashCode();
+ return hashCode;
+ }
}
+
private static string listSeparator = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ListSeparator;
/// <summary>
/// Returns a <see cref="System.String"/> describing the current instance.
/// Defines a 2d box (rectangle).
/// </summary>
[StructLayout(LayoutKind.Sequential)]
- public struct Box2d
+ public struct Box2d : IEquatable<Box2d>
{
+
/// <summary>
/// The left boundary of the structure.
/// </summary>
/// <summary>
/// Gets the hash code for this Box2d.
/// </summary>
- /// <returns></returns>
public override int GetHashCode()
{
- return Left.GetHashCode() ^ Right.GetHashCode() ^ Top.GetHashCode() ^ Bottom.GetHashCode();
+ unchecked
+ {
+ var hashCode = this.Left.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Right.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Top.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Bottom.GetHashCode();
+ return hashCode;
+ }
}
private static string listSeparator = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ListSeparator;
/// <returns>A System.Int32 containing the unique hashcode for this instance.</returns>
public override int GetHashCode()
{
- return Row0.GetHashCode() ^ Row1.GetHashCode();
+ unchecked
+ {
+ return (this.Row0.GetHashCode() * 397) ^ this.Row1.GetHashCode();
+ }
}
#endregion
/// <returns>A System.Int32 containing the unique hashcode for this instance.</returns>
public override int GetHashCode()
{
- return Row0.GetHashCode() ^ Row1.GetHashCode();
+ unchecked
+ {
+ return (this.Row0.GetHashCode() * 397) ^ this.Row1.GetHashCode();
+ }
}
#endregion
/// <returns>A System.Int32 containing the unique hashcode for this instance.</returns>
public override int GetHashCode()
{
- return Row0.GetHashCode() ^ Row1.GetHashCode();
+ unchecked
+ {
+ return (this.Row0.GetHashCode() * 397) ^ this.Row1.GetHashCode();
+ }
}
#endregion
/// <returns>A System.Int32 containing the unique hashcode for this instance.</returns>
public override int GetHashCode()
{
- return Row0.GetHashCode() ^ Row1.GetHashCode();
+ unchecked
+ {
+ return (this.Row0.GetHashCode() * 397) ^ this.Row1.GetHashCode();
+ }
}
#endregion
/// <returns>A System.Int32 containing the unique hashcode for this instance.</returns>
public override int GetHashCode()
{
- return Row0.GetHashCode() ^ Row1.GetHashCode();
+ unchecked
+ {
+ return (this.Row0.GetHashCode() * 397) ^ this.Row1.GetHashCode();
+ }
}
#endregion
/// <returns>A System.Int32 containing the unique hashcode for this instance.</returns>
public override int GetHashCode()
{
- return Row0.GetHashCode() ^ Row1.GetHashCode();
+ unchecked
+ {
+ return (this.Row0.GetHashCode() * 397) ^ this.Row1.GetHashCode();
+ }
}
#endregion
/// <returns>A System.Int32 containing the unique hashcode for this instance.</returns>
public override int GetHashCode()
{
- return Row0.GetHashCode() ^ Row1.GetHashCode() ^ Row2.GetHashCode();
+ unchecked
+ {
+ var hashCode = this.Row0.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Row1.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Row2.GetHashCode();
+ return hashCode;
+ }
}
#endregion
/// <returns>A System.Int32 containing the unique hashcode for this instance.</returns>
public override int GetHashCode()
{
- return Row0.GetHashCode() ^ Row1.GetHashCode() ^ Row2.GetHashCode();
+ unchecked
+ {
+ var hashCode = this.Row0.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Row1.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Row2.GetHashCode();
+ return hashCode;
+ }
}
#endregion
/// <returns>A System.Int32 containing the unique hashcode for this instance.</returns>
public override int GetHashCode()
{
- return Row0.GetHashCode() ^ Row1.GetHashCode() ^ Row2.GetHashCode();
+ unchecked
+ {
+ var hashCode = this.Row0.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Row1.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Row2.GetHashCode();
+ return hashCode;
+ }
}
#endregion
/// <returns>A System.Int32 containing the unique hashcode for this instance.</returns>
public override int GetHashCode()
{
- return Row0.GetHashCode() ^ Row1.GetHashCode() ^ Row2.GetHashCode();
+ unchecked
+ {
+ var hashCode = this.Row0.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Row1.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Row2.GetHashCode();
+ return hashCode;
+ }
}
#endregion
/// <returns>A System.Int32 containing the unique hashcode for this instance.</returns>
public override int GetHashCode()
{
- return Row0.GetHashCode() ^ Row1.GetHashCode() ^ Row2.GetHashCode();
+ unchecked
+ {
+ var hashCode = this.Row0.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Row1.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Row2.GetHashCode();
+ return hashCode;
+ }
}
#endregion
/// <returns>A System.Int32 containing the unique hashcode for this instance.</returns>
public override int GetHashCode()
{
- return Row0.GetHashCode() ^ Row1.GetHashCode() ^ Row2.GetHashCode();
+ unchecked
+ {
+ var hashCode = this.Row0.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Row1.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Row2.GetHashCode();
+ return hashCode;
+ }
}
#endregion
/// <returns>A System.Int32 containing the unique hashcode for this instance.</returns>
public override int GetHashCode()
{
- return Row0.GetHashCode() ^ Row1.GetHashCode() ^ Row2.GetHashCode() ^ Row3.GetHashCode();
+ unchecked
+ {
+ var hashCode = this.Row0.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Row1.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Row2.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Row3.GetHashCode();
+ return hashCode;
+ }
}
#endregion
/// <returns>A System.Int32 containing the unique hashcode for this instance.</returns>
public override int GetHashCode()
{
- return Row0.GetHashCode() ^ Row1.GetHashCode() ^ Row2.GetHashCode() ^ Row3.GetHashCode();
+ unchecked
+ {
+ var hashCode = this.Row0.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Row1.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Row2.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Row3.GetHashCode();
+ return hashCode;
+ }
}
#endregion
/// <returns>A System.Int32 containing the unique hashcode for this instance.</returns>
public override int GetHashCode()
{
- return Row0.GetHashCode() ^ Row1.GetHashCode() ^ Row2.GetHashCode() ^ Row3.GetHashCode();
+ unchecked
+ {
+ var hashCode = this.Row0.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Row1.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Row2.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Row3.GetHashCode();
+ return hashCode;
+ }
}
#endregion
/// <returns>A System.Int32 containing the unique hashcode for this instance.</returns>
public override int GetHashCode()
{
- return Row0.GetHashCode() ^ Row1.GetHashCode() ^ Row2.GetHashCode() ^ Row3.GetHashCode();
+ unchecked
+ {
+ var hashCode = this.Row0.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Row1.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Row2.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Row3.GetHashCode();
+ return hashCode;
+ }
}
#endregion
/// <returns>A System.Int32 containing the unique hashcode for this instance.</returns>
public override int GetHashCode()
{
- return Row0.GetHashCode() ^ Row1.GetHashCode() ^ Row2.GetHashCode();
+ unchecked
+ {
+ var hashCode = this.Row0.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Row1.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Row2.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Row3.GetHashCode();
+ return hashCode;
+ }
}
#endregion
/// <returns>A System.Int32 containing the unique hashcode for this instance.</returns>
public override int GetHashCode()
{
- return Row0.GetHashCode() ^ Row1.GetHashCode() ^ Row2.GetHashCode();
+ unchecked
+ {
+ var hashCode = this.Row0.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Row1.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Row2.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Row3.GetHashCode();
+ return hashCode;
+ }
}
#endregion
/// <returns>A hash code formed from the bitwise XOR of this objects members.</returns>
public override int GetHashCode()
{
- return Xyz.GetHashCode() ^ W.GetHashCode();
+ unchecked
+ {
+ return (this.xyz.GetHashCode() * 397) ^ this.w.GetHashCode();
+ }
}
#endregion
/// Provides the hash code for this object.
/// </summary>
/// <returns>A hash code formed from the bitwise XOR of this objects members.</returns>
+
public override int GetHashCode()
{
- return Xyz.GetHashCode() ^ W.GetHashCode();
+ unchecked
+ {
+ return (this.xyz.GetHashCode() * 397) ^ this.w.GetHashCode();
+ }
}
#endregion
/// <returns>A System.Int32 containing the unique hashcode for this instance.</returns>
public override int GetHashCode()
{
- return X.GetHashCode() ^ Y.GetHashCode();
+ unchecked
+ {
+ return (this.X.GetHashCode() * 397) ^ this.Y.GetHashCode();
+ }
}
#endregion
/// <returns>A System.Int32 containing the unique hashcode for this instance.</returns>
public override int GetHashCode()
{
- return X.GetHashCode() ^ Y.GetHashCode();
+ unchecked
+ {
+ return (this.X.GetHashCode() * 397) ^ this.Y.GetHashCode();
+ }
}
#endregion
/// <returns>A System.Int32 containing the unique hashcode for this instance.</returns>
public override int GetHashCode()
{
- return X.GetHashCode() ^ Y.GetHashCode() ^ Z.GetHashCode();
+ unchecked
+ {
+ var hashCode = this.X.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Y.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Z.GetHashCode();
+ return hashCode;
+ }
}
#endregion
/// <returns>A System.Int32 containing the unique hashcode for this instance.</returns>
public override int GetHashCode()
{
- return X.GetHashCode() ^ Y.GetHashCode() ^ Z.GetHashCode();
+ unchecked
+ {
+ var hashCode = this.X.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Y.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Z.GetHashCode();
+ return hashCode;
+ }
}
#endregion
/// <returns>A System.Int32 containing the unique hashcode for this instance.</returns>
public override int GetHashCode()
{
- return X.GetHashCode() ^ Y.GetHashCode() ^ Z.GetHashCode() ^ W.GetHashCode();
+ unchecked
+ {
+ var hashCode = this.X.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Y.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Z.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.W.GetHashCode();
+ return hashCode;
+ }
}
#endregion
/// <returns>A System.Int32 containing the unique hashcode for this instance.</returns>
public override int GetHashCode()
{
- return X.GetHashCode() ^ Y.GetHashCode() ^ Z.GetHashCode() ^ W.GetHashCode();
+ unchecked
+ {
+ var hashCode = this.X.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Y.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.Z.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.W.GetHashCode();
+ return hashCode;
+ }
}
#endregion