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.

This commit is contained in:
Dan Lake
2011-10-27 00:42:21 -07:00
parent 40bee97015
commit b98613091c
14 changed files with 78 additions and 87 deletions

View File

@@ -1190,7 +1190,21 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
/// <summary>
/// Performs action on all ROOT (not child) scene presences.
/// This is just a shortcut function since frequently actions only appy to root SPs
/// </summary>
/// <param name="action"></param>
public void ForEachRootScenePresence(Action<ScenePresence> action)
{
ForEachScenePresence(delegate(ScenePresence sp)
{
if (!sp.IsChildAgent)
action(sp);
});
}
/// <summary>
/// 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