mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 18:55:58 +08:00
* 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.
This commit is contained in:
@@ -71,21 +71,25 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
public void Remove(uint localID)
|
||||
public bool Remove(uint localID)
|
||||
{
|
||||
lock(m_lock)
|
||||
{
|
||||
m_eb_uuid.Remove(m_eb_localID[localID].UUID);
|
||||
m_eb_localID.Remove(localID);
|
||||
bool a = m_eb_uuid.Remove(m_eb_localID[localID].UUID);
|
||||
bool b = m_eb_localID.Remove(localID);
|
||||
|
||||
return a && b;
|
||||
}
|
||||
}
|
||||
|
||||
public void Remove(UUID id)
|
||||
public bool Remove(UUID id)
|
||||
{
|
||||
lock(m_lock)
|
||||
{
|
||||
m_eb_localID.Remove(m_eb_uuid[id].LocalId);
|
||||
m_eb_uuid.Remove(id);
|
||||
bool a = m_eb_localID.Remove(m_eb_uuid[id].LocalId);
|
||||
bool b = m_eb_uuid.Remove(id);
|
||||
|
||||
return a && b;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,6 +149,22 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
public bool TryGetValue(UUID key, out EntityBase obj)
|
||||
{
|
||||
lock(m_lock)
|
||||
{
|
||||
return m_eb_uuid.TryGetValue(key, out obj);
|
||||
}
|
||||
}
|
||||
|
||||
public bool TryGetValue(uint key, out EntityBase obj)
|
||||
{
|
||||
lock (m_lock)
|
||||
{
|
||||
return m_eb_localID.TryGetValue(key, out obj);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This could be optimised to work on the list 'live' rather than making a safe copy and iterating that.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user