From 39b64564dca0e5cb57a2a8e1b60979ccaaf11ef6 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Thu, 26 Jul 2007 14:55:42 +0000 Subject: * Started renaming world to Scene * Update and UpdateMovement now first stores array to avoid collection update exceptions * Ignored some bins --- OpenSim/Region/Environment/Scenes/Scene.cs | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs') diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 0e25e54..39584ad 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -140,23 +140,23 @@ namespace OpenSim.Region.Environment.Scenes m_eventManager = new EventManager(); m_eventManager.OnParcelPrimCountAdd += - new EventManager.OnParcelPrimCountAddDelegate(m_LandManager.addPrimToLandPrimCounts); + m_LandManager.addPrimToLandPrimCounts; - MainLog.Instance.Verbose("World.cs - creating new entitities instance"); + MainLog.Instance.Verbose("Creating new entitities instance"); Entities = new Dictionary(); Avatars = new Dictionary(); Prims = new Dictionary(); - MainLog.Instance.Verbose("World.cs - loading objects from datastore"); + MainLog.Instance.Verbose("Loading objects from datastore"); List PrimsFromDB = storageManager.DataStore.LoadObjects(); foreach (SceneObject prim in PrimsFromDB) { AddEntity(prim); } - MainLog.Instance.Verbose("World.cs - loaded " + PrimsFromDB.Count.ToString() + " object(s)"); + MainLog.Instance.Verbose("Loaded " + PrimsFromDB.Count.ToString() + " object(s)"); - MainLog.Instance.Verbose("World.cs - creating LandMap"); + MainLog.Instance.Verbose("Creating LandMap"); Terrain = new TerrainEngine(); ScenePresence.LoadAnims(); @@ -198,7 +198,7 @@ namespace OpenSim.Region.Environment.Scenes } /// - /// Performs per-frame updates on the world, this should be the central world loop + /// Performs per-frame updates on the scene, this should be the central world loop /// public override void Update() { @@ -210,9 +210,11 @@ namespace OpenSim.Region.Environment.Scenes phyScene.GetResults(); } - foreach (LLUUID UUID in Entities.Keys) + List moveEntities = new List( Entities.Values ); + + foreach (EntityBase entity in moveEntities) { - Entities[UUID].updateMovement(); + entity.UpdateMovement(); } lock (m_syncRoot) @@ -220,9 +222,11 @@ namespace OpenSim.Region.Environment.Scenes phyScene.Simulate(timeStep); } - foreach (LLUUID UUID in Entities.Keys) + List updateEntities = new List(Entities.Values); + + foreach (EntityBase entity in updateEntities) { - Entities[UUID].Update(); + entity.Update(); } // General purpose event manager -- cgit v1.1