Example #1
0
        public bool NeedsUpdate(IBoundedObject component)
        {
            if (ObjectsToUpdate.ContainsKey(component))
            {
                return(false);
            }

            return(!ObjectsToNodes.ContainsKey(component) || ObjectsToNodes[component].Bounds.Intersects(component.GetBoundingBox()));
        }
Example #2
0
        public void Update(DwarfTime time)
        {
            UpdateTimer.Update(time);

            if (!UpdateTimer.HasTriggered)
            {
                return;
            }

            lock (ObjectsToUpdate)
            {
                foreach (KeyValuePair <IBoundedObject, bool> pair in ObjectsToUpdate)
                {
                    RemoveObject(pair.Key);
                    AddObjectRecursive(pair.Key);
                }

                ObjectsToUpdate.Clear();
            }
        }