diff options
author | Adam Frisby | 2009-04-01 09:31:40 +0000 |
---|---|---|
committer | Adam Frisby | 2009-04-01 09:31:40 +0000 |
commit | 5cd70a8c0e3786712fa7dc3be8c947829be060c7 (patch) | |
tree | 3bd74ef71efbce10631126477b51518c40e0d4ee /OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs | |
parent | * Adds World.Avatars[] to MRM Scripting. Contains an enumerable array contain... (diff) | |
download | opensim-SC-5cd70a8c0e3786712fa7dc3be8c947829be060c7.zip opensim-SC-5cd70a8c0e3786712fa7dc3be8c947829be060c7.tar.gz opensim-SC-5cd70a8c0e3786712fa7dc3be8c947829be060c7.tar.bz2 opensim-SC-5cd70a8c0e3786712fa7dc3be8c947829be060c7.tar.xz |
* MRM Adjustments
* Changes World.Objects from Array IObject[] to IObjectAccessor.
* Syntactically identical in most behaviour, however the indexer is now ranges not from 0..Count, but any valid internal LocalID. Additional indexers have been added for UUID.
* Example: for(int i=0;i<World.Objects.Count;i++) will not work any more, however foreach(World.Objects) will remain functional.
* This prevents us needing to create a list for each access to World.Objects which should [in theory] present a dramatic speed improvement to MRM scripts frequently accessing World.Objects.
Diffstat (limited to 'OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs')
-rw-r--r-- | OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs index 4ba6778..987868a 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs | |||
@@ -35,27 +35,18 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
35 | private readonly Scene m_internalScene; | 35 | private readonly Scene m_internalScene; |
36 | private readonly Heightmap m_heights; | 36 | private readonly Heightmap m_heights; |
37 | 37 | ||
38 | private ObjectAccessor m_objs; | ||
39 | |||
38 | public World(Scene internalScene) | 40 | public World(Scene internalScene) |
39 | { | 41 | { |
40 | m_internalScene = internalScene; | 42 | m_internalScene = internalScene; |
41 | m_heights = new Heightmap(m_internalScene); | 43 | m_heights = new Heightmap(m_internalScene); |
44 | m_objs = new ObjectAccessor(m_internalScene); | ||
42 | } | 45 | } |
43 | 46 | ||
44 | public IObject[] Objects | 47 | public IObjectAccessor Objects |
45 | { | 48 | { |
46 | get | 49 | get { return m_objs; } |
47 | { | ||
48 | List<EntityBase> ents = m_internalScene.Entities.GetAllByType<SceneObjectGroup>(); | ||
49 | IObject[] rets = new IObject[ents.Count]; | ||
50 | |||
51 | for (int i = 0; i < ents.Count; i++) | ||
52 | { | ||
53 | EntityBase ent = ents[i]; | ||
54 | rets[i] = new SOPObject(m_internalScene, ent.LocalId); | ||
55 | } | ||
56 | |||
57 | return rets; | ||
58 | } | ||
59 | } | 50 | } |
60 | 51 | ||
61 | public IAvatar[] Avatars | 52 | public IAvatar[] Avatars |