protected override void OnOperationFound(FileSystemOperation operation) { PendingOperations.Add(new OperationItem(operation)); if (ShouldUpdate()) { RequestUpdate(); } }
public void EnqueueOperation(BoundingBox box, bool skyLight, bool initial = false) { lock (_Lock) { // Try to merge with existing operation for (int i = PendingOperations.Count - 1; i > PendingOperations.Count - 5 && i > 0; i--) { var op = PendingOperations[i]; if (op.Box.Intersects(box)) { op.Box = new BoundingBox(Vector3.Min(op.Box.Min, box.Min), Vector3.Max(op.Box.Max, box.Max)); return; } } PendingOperations.Add(new LightingOperation { SkyLight = skyLight, Box = box, Initial = initial }); } }