Added functions to find prims by name

0.6.0-stable
Johan Berntsson 2008-10-01 06:39:36 +00:00
parent 6754681e5b
commit 513ce9caee
2 changed files with 37 additions and 0 deletions

View File

@ -821,6 +821,32 @@ namespace OpenSim.Region.Environment.Scenes
else else
return null; return null;
} }
/// <summary>
/// Get a named prim contained in this 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 SceneObjectPart GetSceneObjectPart(string name)
{
List<EntityBase> EntityList = GetEntities();
foreach (EntityBase ent in EntityList)
{
if (ent is SceneObjectGroup)
{
foreach(SceneObjectPart p in ((SceneObjectGroup) ent).GetParts())
{
if (p.Name==name)
{
return p;
}
}
}
}
return null;
}
/// <summary> /// <summary>
/// Get a part contained in this scene. /// Get a part contained in this scene.

View File

@ -3882,6 +3882,17 @@ namespace OpenSim.Region.Environment.Scenes
// } // }
// } // }
/// <summary>
/// Get a named prim contained in this scene (will return the first
/// found, if there are more than one prim with the same name)
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
public SceneObjectPart GetSceneObjectPart(string name)
{
return m_innerScene.GetSceneObjectPart(name);
}
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>