using System.Drawing; namespace HeuristicLab.Problems.RoutePlanning.Utilities { public struct PointD { public double X; public double Y; #region Constructors public PointD(double x, double y) { this.X = x; this.Y = y; } public PointD(PointD p) { this.X = p.X; this.Y = p.Y; } #endregion #region Operators public static bool operator !=(PointD left, PointD right) { return left.X != right.X || left.Y != right.Y; } public static bool operator ==(PointD left, PointD right) { return left.X == right.X && left.Y == right.Y; } public static explicit operator PointF(PointD p) { return new PointF((float)p.X, (float)p.Y); } #endregion #region Overridden Methods public override bool Equals(object obj) { if (obj is PointD) { PointD p = (PointD)obj; return (this.X == p.X && this.Y == p.Y); } return false; } public override int GetHashCode() { return ((PointF)this).GetHashCode(); } #endregion } }