Ejemplo n.º 1
0
        // private
        private void ReculculateNodeList()
        {
            if (boundsChanged)
            {
                root = new QuadLeaf <T>(0.0d, 0.0d, width, height);
                removedSet.Clear();

                foreach (T node in objects)
                {
                    changedSet.Remove(node);
                    addedSet.Remove(node);
                    root.Add(node);
                }
            }
            else
            {
                foreach (T node in addedSet)
                {
                    root.Add(node);
                    addedSet.Remove(node);
                }
                foreach (T node in changedSet)
                {
                    root.Move(node);
                    changedSet.Remove(node);
                }
                foreach (T node in removedSet)
                {
                    root.Remove(node);
                    removedSet.Remove(node);
                }
            }
        }