diff --git a/Models/Common.cs b/Models/Common.cs index 8476bac..f519e2a 100644 --- a/Models/Common.cs +++ b/Models/Common.cs @@ -109,6 +109,20 @@ namespace ActiveProtect.Models return !(left == right); } + public override bool Equals(object? obj) + { + if (obj is Vector3D other) + { + return this == other; + } + return false; + } + + public override int GetHashCode() + { + return HashCode.Combine(X, Y, Z); + } + /// /// 计算向量的模长 /// @@ -190,6 +204,7 @@ namespace ActiveProtect.Models Vector3D unitDirection = direction.Normalize(); return a + unitDirection * distance; } + } ///