コード例 #1
0
ファイル: QuadTree.cs プロジェクト: ddl2829/space-shooter
        private int ObjectCount()
        {
            int count = 0;

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

            // Add the objects that are contained in the children
            if (childTL != null)
            {
                count += childTL.ObjectCount();
                count += childTR.ObjectCount();
                count += childBL.ObjectCount();
                count += childBR.ObjectCount();
            }

            return(count);
        }