public int CompareTo(ICorner other) { // these must be run in other. // Do not consolidate these. if (m_Location.Y < other.GetLocation().Y) { return(-1); } if (m_Location.Y > other.GetLocation().Y) { return(1); } if (m_Location.X < other.GetLocation().X) { return(-1); } if (m_Location.X > other.GetLocation().X) { return(1); } return(0); }
public int CompareTo(ICorner other) { // Order matters here if (m_Location.Y < other.GetLocation().Y) { return(-1); } if (m_Location.Y > other.GetLocation().Y) { return(1); } if (m_Location.X < other.GetLocation().X) { return(-1); } if (m_Location.X > other.GetLocation().X) { return(1); } return(0); }
internal bool IsAdjacentTo(ICorner c) { bool bOk = false; if (!Equals(c)) { if (GetLocation().X == c.GetLocation().X) { bOk = (Math.Abs(GetLocation().Y - c.GetLocation().Y) == difference); } else if (GetLocation().Y == c.GetLocation().Y) { bOk = (Math.Abs(GetLocation().X - c.GetLocation().X) == difference); } } return(bOk); }
public bool Equals(ICorner other) { return(m_Location == other.GetLocation()); }
public bool Equals(ICorner other) => m_Location == other.GetLocation();