Example #1
0
        /// <summary>
        /// Clears the QuadTree of all objects, including any objects living in its children.
        /// </summary>
        internal void Clear()
        {
            // Clear out the children, if we have any
            if (_childTL != null)
            {
                _childTL.Clear();
                _childTR.Clear();
                _childBL.Clear();
                _childBR.Clear();
            }

            // Clear any objects at this level
            if (_objects != null)
            {
                _objects.Clear();
                _objects = null;
            }

            // Set the children to null
            _childTL = null;
            _childTR = null;
            _childBL = null;
            _childBR = null;
        }
Example #2
0
 ///<summary>
 ///Removes all items from the <see cref="T:System.Collections.Generic.ICollection`1" />.
 ///</summary>
 ///
 ///<exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.ICollection`1" /> is read-only. </exception>
 public void Clear()
 {
     _wrappedDictionary.Clear();
     _quadTreeRoot.Clear();
 }