using System.Globalization; namespace ScreenConnect; public struct CorePoint { public int X { get; set; } public int Y { get; set; } public CorePoint(int x, int y) { this = default(CorePoint); X = x; Y = y; } public static bool operator ==(CorePoint left, CorePoint right) { if (left.X == right.X) { return left.Y == right.Y; } return false; } public static bool operator !=(CorePoint left, CorePoint right) { return !(left == right); } public static CorePoint operator +(CorePoint a, CorePoint b) { return new CorePoint(a.X + b.X, a.Y + b.Y); } public static CorePoint operator -(CorePoint a, CorePoint b) { return new CorePoint(a.X - b.X, a.Y - b.Y); } public static CorePoint operator -(CorePoint point) { return new CorePoint(-point.X, -point.Y); } public double DistanceTo(CorePoint point) { return Extensions.DistanceBetween(X, Y, point.X, point.Y); } public override bool Equals(object obj) { if (!(obj is CorePoint corePoint)) { return false; } if (corePoint.X == X) { return corePoint.Y == Y; } return false; } public override int GetHashCode() { return X ^ Y; } public override string ToString() { return "{X=" + X.ToString(CultureInfo.CurrentCulture) + ",Y=" + Y.ToString(CultureInfo.CurrentCulture) + "}"; } }