implement Scene.GetSceneObjectGroup(string name) to match the equivalent GetSOP method

bulletsim
Justin Clark-Casey (justincc) 2011-05-20 23:41:14 +01:00
parent 91a9f30b16
commit 4b0fc4faef
2 changed files with 43 additions and 3 deletions

View File

@ -4282,14 +4282,25 @@ namespace OpenSim.Region.Framework.Scenes
/// Get a group via its UUID
/// </summary>
/// <param name="fullID"></param>
/// <returns></returns>
/// <returns>null if no group with that name exists</returns>
public SceneObjectGroup GetSceneObjectGroup(UUID fullID)
{
return m_sceneGraph.GetSceneObjectGroup(fullID);
}
/// <summary>
/// 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)
/// </summary>
/// <param name="name"></param>
/// <returns>null if no group with that name exists</returns>
public SceneObjectGroup GetSceneObjectGroup(string name)
{
return m_sceneGraph.GetSceneObjectGroup(name);
}
/// <summary>
/// Get a prim by name from the scene (will return the first
/// found, if there are more than one prim with the same name)
/// </summary>
/// <param name="name"></param>

View File

@ -991,6 +991,35 @@ namespace OpenSim.Region.Framework.Scenes
return null;
}
/// <summary>
/// Get a group by name from the scene (will return the first
/// found, if there are more than one prim with the same name)
/// </summary>
/// <param name="name"></param>
/// <returns>null if the part was not found</returns>
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;
}
/// <summary>
/// Get a part contained in this scene.
/// </summary>
@ -1005,7 +1034,7 @@ namespace OpenSim.Region.Framework.Scenes
}
/// <summary>
/// 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)
/// </summary>
/// <param name="name"></param>