예제 #1
0
        public bool AreBoxableCorners(Corner ul, Corner ur, Corner ll, Corner lr)
        {
            bool areBoxable = false;

            if (CornerPointOnBoard(ul.Location) && CornerPointOnBoard(ur.Location) &&
                CornerPointOnBoard(ll.Location) && CornerPointOnBoard(lr.Location))
            {
                if (ul.IsAdjacentTo(ll) && ul.IsAdjacentTo(ur))
                {
                    if (lr.IsAdjacentTo(ll) && lr.IsAdjacentTo(ur))
                    {
                        areBoxable = true;
                    }
                }
            }

            return(areBoxable);
        }
예제 #2
0
 public Line(Corner c1, Corner c2)
 {
     if (c1.IsAdjacentTo(c2))
     {
         if (c1.CompareTo(c2) < 0)
         {
             m_Start = c1;
             m_End   = c2;
         }
         else
         {
             m_Start = c2;
             m_End   = c1;
         }
     }
     else
     {
         throw new ArgumentException("Corners not adjacent");
     }
 }