Exemplo n.º 1
0
 public void Remove(Rectangle rect)
 {
     for (int index = this.m_Count - 1; index >= 0; --index)
     {
         Rectangle rectangle = this.m_Rects[index];
         if (rect.IntersectsWith(rectangle))
         {
             this.InternalRemove(index);
             foreach (Rectangle rect1 in RectangleList.Punch(rectangle, rect))
             {
                 this.InternalAdd(rect1);
             }
         }
     }
 }
Exemplo n.º 2
0
 public void Add(Rectangle rect)
 {
     for (int index = 0; index < this.m_Count; ++index)
     {
         Rectangle rectangle = this.m_Rects[index];
         if (rect.IntersectsWith(rectangle))
         {
             foreach (Rectangle rect1 in RectangleList.Punch(rect, rectangle))
             {
                 this.Add(rect1);
             }
             return;
         }
     }
     this.InternalAdd(rect);
 }