Example #1
0
        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);
        }
Example #2
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);
        }
Example #3
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);
        }
Example #4
0
 public bool Equals(ICorner other)
 {
     return(m_Location == other.GetLocation());
 }
Example #5
0
 public bool Equals(ICorner other) => m_Location == other.GetLocation();