diff options
author | Adam Frisby | 2008-11-24 14:45:05 +0000 |
---|---|---|
committer | Adam Frisby | 2008-11-24 14:45:05 +0000 |
commit | 47829849d99e1ec6e11ac26e1f892cbaf94d5503 (patch) | |
tree | 8f6d4371874f1716312bf0752e9251f20dc920c2 /OpenSim/Region/Environment/Scenes/Scene.cs | |
parent | * Makes EntityManager IEnumerable - meaning we should be good to go to enable... (diff) | |
download | opensim-SC_OLD-47829849d99e1ec6e11ac26e1f892cbaf94d5503.zip opensim-SC_OLD-47829849d99e1ec6e11ac26e1f892cbaf94d5503.tar.gz opensim-SC_OLD-47829849d99e1ec6e11ac26e1f892cbaf94d5503.tar.bz2 opensim-SC_OLD-47829849d99e1ec6e11ac26e1f892cbaf94d5503.tar.xz |
* Swaps Scene.Entities Dictionary for EntityManager.
* Important Changes: Scene.Entities is now IEnumerable directly. You do not need to use Entities.Values, you can Enumerate on .Entities directly. (So 'foreach Scene.Entities' vs 'foreach Scene.Entities.Values').
* Locks: Entities maintains it's own internal locking states. This means you do not need to lock entities anymore. I'll be going through and removing locks on it systematically.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index d2e797a..55e8634 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -244,6 +244,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
244 | // set { m_sceneGraph.SceneObjects = value; } | 244 | // set { m_sceneGraph.SceneObjects = value; } |
245 | // } | 245 | // } |
246 | 246 | ||
247 | /** | ||
247 | /// <summary> | 248 | /// <summary> |
248 | /// The dictionary of all entities in this scene. The contents of this dictionary may be changed at any time. | 249 | /// The dictionary of all entities in this scene. The contents of this dictionary may be changed at any time. |
249 | /// If you wish to add or remove entities, please use the appropriate method for that entity rather than | 250 | /// If you wish to add or remove entities, please use the appropriate method for that entity rather than |
@@ -257,6 +258,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
257 | get { return m_sceneGraph.Entities; } | 258 | get { return m_sceneGraph.Entities; } |
258 | set { m_sceneGraph.Entities = value; } | 259 | set { m_sceneGraph.Entities = value; } |
259 | } | 260 | } |
261 | */ | ||
262 | public EntityManager Entities | ||
263 | { | ||
264 | get { return m_sceneGraph.Entities; } | ||
265 | } | ||
260 | 266 | ||
261 | public Dictionary<UUID, ScenePresence> m_restorePresences | 267 | public Dictionary<UUID, ScenePresence> m_restorePresences |
262 | { | 268 | { |
@@ -605,7 +611,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
605 | m_log.Info("Stopping all Scripts in Scene"); | 611 | m_log.Info("Stopping all Scripts in Scene"); |
606 | lock (Entities) | 612 | lock (Entities) |
607 | { | 613 | { |
608 | foreach (EntityBase ent in Entities.Values) | 614 | foreach (EntityBase ent in Entities) |
609 | { | 615 | { |
610 | if (ent is SceneObjectGroup) | 616 | if (ent is SceneObjectGroup) |
611 | { | 617 | { |
@@ -619,7 +625,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
619 | m_log.Info("Starting all Scripts in Scene"); | 625 | m_log.Info("Starting all Scripts in Scene"); |
620 | lock (Entities) | 626 | lock (Entities) |
621 | { | 627 | { |
622 | foreach (EntityBase ent in Entities.Values) | 628 | foreach (EntityBase ent in Entities) |
623 | { | 629 | { |
624 | if (ent is SceneObjectGroup) | 630 | if (ent is SceneObjectGroup) |
625 | { | 631 | { |
@@ -1857,7 +1863,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1857 | { | 1863 | { |
1858 | lock (Entities) | 1864 | lock (Entities) |
1859 | { | 1865 | { |
1860 | ICollection<EntityBase> entities = new List<EntityBase>(Entities.Values); | 1866 | ICollection<EntityBase> entities = new List<EntityBase>(Entities); |
1861 | 1867 | ||
1862 | foreach (EntityBase e in entities) | 1868 | foreach (EntityBase e in entities) |
1863 | { | 1869 | { |