From 4b0fc4faef657cc819dfa360fb6a266532724455 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 20 May 2011 23:41:14 +0100 Subject: implement Scene.GetSceneObjectGroup(string name) to match the equivalent GetSOP method --- OpenSim/Region/Framework/Scenes/Scene.cs | 15 +++++++++++-- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 31 ++++++++++++++++++++++++++- 2 files changed, 43 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index f718331..cfb3a5d 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -4282,14 +4282,25 @@ namespace OpenSim.Region.Framework.Scenes /// Get a group via its UUID /// /// - /// + /// null if no group with that name exists public SceneObjectGroup GetSceneObjectGroup(UUID fullID) { return m_sceneGraph.GetSceneObjectGroup(fullID); } /// - /// Get a named prim contained in this scene (will return the first + /// Get a group by name from the scene (will return the first + /// found, if there are more than one prim with the same name) + /// + /// + /// null if no group with that name exists + public SceneObjectGroup GetSceneObjectGroup(string name) + { + return m_sceneGraph.GetSceneObjectGroup(name); + } + + /// + /// Get a prim by name from the scene (will return the first /// found, if there are more than one prim with the same name) /// /// diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 2d547f7..0cff011 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -992,6 +992,35 @@ namespace OpenSim.Region.Framework.Scenes } /// + /// Get a group by name from the scene (will return the first + /// found, if there are more than one prim with the same name) + /// + /// + /// null if the part was not found + protected internal SceneObjectGroup GetSceneObjectGroup(string name) + { + SceneObjectGroup so = null; + + Entities.Find( + delegate(EntityBase entity) + { + if (entity is SceneObjectGroup) + { + if (entity.Name == name) + { + so = (SceneObjectGroup)entity; + return true; + } + } + + return false; + } + ); + + return so; + } + + /// /// Get a part contained in this scene. /// /// @@ -1005,7 +1034,7 @@ namespace OpenSim.Region.Framework.Scenes } /// - /// Get a named prim contained in this scene (will return the first + /// Get a prim by name from the scene (will return the first /// found, if there are more than one prim with the same name) /// /// -- cgit v1.1