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 | |
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 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/InnerScene.cs | 26 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 11 |
2 files changed, 37 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. |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 3799259..bbc50e6 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -3882,6 +3882,17 @@ namespace OpenSim.Region.Environment.Scenes | |||
3882 | // } | 3882 | // } |
3883 | // } | 3883 | // } |
3884 | 3884 | ||
3885 | /// <summary> | ||
3886 | /// Get a named prim contained in this scene (will return the first | ||
3887 | /// found, if there are more than one prim with the same name) | ||
3888 | /// </summary> | ||
3889 | /// <param name="name"></param> | ||
3890 | /// <returns></returns> | ||
3891 | public SceneObjectPart GetSceneObjectPart(string name) | ||
3892 | { | ||
3893 | return m_innerScene.GetSceneObjectPart(name); | ||
3894 | } | ||
3895 | |||
3885 | /// <summary> | 3896 | /// <summary> |
3886 | /// | 3897 | /// |
3887 | /// </summary> | 3898 | /// </summary> |