daily update on 20230228 by nitload youmu
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Vector
|
||||
{
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
public struct Array2x3:IEquatable<Array2x3>
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
Vec3D row1;
|
||||
[FieldOffset(12)]
|
||||
Vec3D row2;
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
return obj is Array2x3 x &&
|
||||
row1.Equals(x.row1) &&
|
||||
row2.Equals(x.row2);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return HashCode.Combine(row1, row2);
|
||||
}
|
||||
|
||||
bool IEquatable<Array2x3>.Equals(Array2x3 other)
|
||||
{
|
||||
if (this.GetHashCode() != other.GetHashCode())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return
|
||||
this.row1 == other.row1
|
||||
&& this.row2 == other.row2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user