diff options
author | Johan Berntsson | 2008-10-01 06:39:36 +0000 |
---|---|---|
committer | Johan Berntsson | 2008-10-01 06:39:36 +0000 |
commit | 513ce9caee7bbacc167c1f3241e64e201ac412cf (patch) | |
tree | e830ac8bcc967ca9208b94e709e0b5da31db179e /OpenSim/Region/Environment/Scenes/InnerScene.cs | |
parent | * Adds error handlers for errors parsing the querystring passed on the OSHttp... (diff) | |
download | opensim-SC-513ce9caee7bbacc167c1f3241e64e201ac412cf.zip opensim-SC-513ce9caee7bbacc167c1f3241e64e201ac412cf.tar.gz opensim-SC-513ce9caee7bbacc167c1f3241e64e201ac412cf.tar.bz2 opensim-SC-513ce9caee7bbacc167c1f3241e64e201ac412cf.tar.xz |
Added functions to find prims by name
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/InnerScene.cs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index cd5a9f5..3be1592 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs | |||
@@ -821,6 +821,32 @@ namespace OpenSim.Region.Environment.Scenes | |||
821 | else | 821 | else |
822 | return null; | 822 | return null; |
823 | } | 823 | } |
824 | |||
825 | /// <summary> | ||
826 | /// Get a named prim contained in this scene (will return the first | ||
827 | /// found, if there are more than one prim with the same name) | ||
828 | /// </summary> | ||
829 | /// <param name="name"></param> | ||
830 | /// <returns>null if the part was not found</returns> | ||
831 | protected internal SceneObjectPart GetSceneObjectPart(string name) | ||
832 | { | ||
833 | List<EntityBase> EntityList = GetEntities(); | ||
834 | |||
835 | foreach (EntityBase ent in EntityList) | ||
836 | { | ||
837 | if (ent is SceneObjectGroup) | ||
838 | { | ||
839 | foreach(SceneObjectPart p in ((SceneObjectGroup) ent).GetParts()) | ||
840 | { | ||
841 | if (p.Name==name) | ||
842 | { | ||
843 | return p; | ||
844 | } | ||
845 | } | ||
846 | } | ||
847 | } | ||
848 | return null; | ||
849 | } | ||
824 | 850 | ||
825 | /// <summary> | 851 | /// <summary> |
826 | /// Get a part contained in this scene. | 852 | /// Get a part contained in this scene. |