From b98613091cd6dc2f914fb5ab38ca33cdff21fc24 Mon Sep 17 00:00:00 2001
From: Dan Lake
Date: Thu, 27 Oct 2011 00:42:21 -0700
Subject: Added new ForEachRootScenePresence to Scene since almost every
delegate passed to ForEachScenePresence checks for !IsChildAgent first. It
consolidates child and root handling for coming refactors.
---
OpenSim/Region/Framework/Scenes/SceneGraph.cs | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneGraph.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index caec704..542bd51 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1190,7 +1190,21 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
-
+
+ ///
+ /// Performs action on all ROOT (not child) scene presences.
+ /// This is just a shortcut function since frequently actions only appy to root SPs
+ ///
+ ///
+ public void ForEachRootScenePresence(Action action)
+ {
+ ForEachScenePresence(delegate(ScenePresence sp)
+ {
+ if (!sp.IsChildAgent)
+ action(sp);
+ });
+ }
+
///
/// Performs action on all scene presences. This can ultimately run the actions in parallel but
/// any delegates passed in will need to implement their own locking on data they reference and
--
cgit v1.1