* Refactor: Remove SceneObjectGroup.GetScenePresences() in favour of a direct call to Scene

0.6.0-stable
Justin Clarke Casey 2008-05-14 21:09:41 +00:00
parent c565391a70
commit 587f6ab645
4 changed files with 13 additions and 20 deletions

View File

@ -35,13 +35,15 @@ namespace OpenSim.Region.Environment.Scenes
{ {
[Serializable] [Serializable]
public abstract class EntityBase : ISerializable public abstract class EntityBase : ISerializable
{ {
protected Scene m_scene; /// <summary>
/// The scene to which this entity belongs
/// </summary>
public Scene Scene public Scene Scene
{ {
get { return m_scene; } get { return m_scene; }
} }
protected Scene m_scene;
protected LLUUID m_uuid; protected LLUUID m_uuid;

View File

@ -3096,7 +3096,7 @@ namespace OpenSim.Region.Environment.Scenes
} }
/// <summary> /// <summary>
/// Request a List of all ScenePresences in this region /// Request a List of all ScenePresences in this region. This returns child agents as well as root agents.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public List<ScenePresence> GetScenePresences() public List<ScenePresence> GetScenePresences()

View File

@ -785,15 +785,6 @@ namespace OpenSim.Region.Environment.Scenes
part.ClearUndoState(); part.ClearUndoState();
} }
/// <summary>
///
/// </summary>
/// <returns></returns>
public List<ScenePresence> GetScenePresences()
{
return m_scene.GetScenePresences();
}
public override void UpdateMovement() public override void UpdateMovement()
{ {
lock (m_parts) lock (m_parts)
@ -933,7 +924,7 @@ namespace OpenSim.Region.Environment.Scenes
{ {
foreach (SceneObjectPart part in m_parts.Values) foreach (SceneObjectPart part in m_parts.Values)
{ {
List<ScenePresence> avatars = GetScenePresences(); List<ScenePresence> avatars = Scene.GetScenePresences();
for (int i = 0; i < avatars.Count; i++) for (int i = 0; i < avatars.Count; i++)
{ {
if (avatars[i].ParentID == LocalId) if (avatars[i].ParentID == LocalId)

View File

@ -2247,7 +2247,7 @@ namespace OpenSim.Region.Environment.Scenes
private void SendObjectPropertiesToClient(LLUUID AgentID) private void SendObjectPropertiesToClient(LLUUID AgentID)
{ {
List<ScenePresence> avatars = m_parentGroup.GetScenePresences(); List<ScenePresence> avatars = m_parentGroup.Scene.GetScenePresences();
for (int i = 0; i < avatars.Count; i++) for (int i = 0; i < avatars.Count; i++)
{ {
// Ugly reference :( // Ugly reference :(
@ -2277,7 +2277,7 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary> /// </summary>
public void AddFullUpdateToAllAvatars() public void AddFullUpdateToAllAvatars()
{ {
List<ScenePresence> avatars = m_parentGroup.GetScenePresences(); List<ScenePresence> avatars = m_parentGroup.Scene.GetScenePresences();
for (int i = 0; i < avatars.Count; i++) for (int i = 0; i < avatars.Count; i++)
{ {
avatars[i].QueuePartForUpdate(this); avatars[i].QueuePartForUpdate(this);
@ -2286,7 +2286,7 @@ namespace OpenSim.Region.Environment.Scenes
public void SendFullUpdateToAllClientsExcept(LLUUID agentID) public void SendFullUpdateToAllClientsExcept(LLUUID agentID)
{ {
List<ScenePresence> avatars = m_parentGroup.GetScenePresences(); List<ScenePresence> avatars = m_parentGroup.Scene.GetScenePresences();
for (int i = 0; i < avatars.Count; i++) for (int i = 0; i < avatars.Count; i++)
{ {
// Ugly reference :( // Ugly reference :(
@ -2309,7 +2309,7 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary> /// </summary>
public void SendFullUpdateToAllClients() public void SendFullUpdateToAllClients()
{ {
List<ScenePresence> avatars = m_parentGroup.GetScenePresences(); List<ScenePresence> avatars = m_parentGroup.Scene.GetScenePresences();
for (int i = 0; i < avatars.Count; i++) for (int i = 0; i < avatars.Count; i++)
{ {
// Ugly reference :( // Ugly reference :(
@ -2370,7 +2370,7 @@ namespace OpenSim.Region.Environment.Scenes
/// Terse updates /// Terse updates
public void AddTerseUpdateToAllAvatars() public void AddTerseUpdateToAllAvatars()
{ {
List<ScenePresence> avatars = m_parentGroup.GetScenePresences(); List<ScenePresence> avatars = m_parentGroup.Scene.GetScenePresences();
for (int i = 0; i < avatars.Count; i++) for (int i = 0; i < avatars.Count; i++)
{ {
avatars[i].QueuePartForUpdate(this); avatars[i].QueuePartForUpdate(this);
@ -2387,7 +2387,7 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary> /// </summary>
public void SendTerseUpdateToAllClients() public void SendTerseUpdateToAllClients()
{ {
List<ScenePresence> avatars = m_parentGroup.GetScenePresences(); List<ScenePresence> avatars = m_parentGroup.Scene.GetScenePresences();
for (int i = 0; i < avatars.Count; i++) for (int i = 0; i < avatars.Count; i++)
{ {
m_parentGroup.SendPartTerseUpdate(avatars[i].ControllingClient, this); m_parentGroup.SendPartTerseUpdate(avatars[i].ControllingClient, this);