Пример #1
0
        /// <summary>
        /// Get the total for all objects in this QuadTree, including children.
        /// </summary>
        /// <returns>The number of objects contained within this QuadTree and its children.</returns>
        private int ObjectCount()
        {
            int count = 0;

            // Add the objects at this level
            if (m_objects != null)
            {
                count += m_objects.Count;
            }

            // Add the objects that are contained in the children
            if (m_childTL != null)
            {
                count += m_childTL.ObjectCount();
                count += m_childTR.ObjectCount();
                count += m_childBL.ObjectCount();
                count += m_childBR.ObjectCount();
            }

            return(count);
        }