public bool NeedsUpdate(IBoundedObject component) { if (ObjectsToUpdate.ContainsKey(component)) { return(false); } return(!ObjectsToNodes.ContainsKey(component) || ObjectsToNodes[component].Bounds.Intersects(component.GetBoundingBox())); }
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(); } }