public void SelectPrim(uint primLocalID, IClientAPI remoteClient)
{
EntityBase[] entityList = GetEntities();
foreach (EntityBase ent in entityList)
{
if (ent is SceneObjectGroup)
{
if (((SceneObjectGroup) ent).LocalId == primLocalID)
{
((SceneObjectGroup) ent).GetProperties(remoteClient);
((SceneObjectGroup) ent).IsSelected = true;
// A prim is only tainted if it's allowed to be edited by the person clicking it.
if (Permissions.CanEditObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId)
|| Permissions.CanMoveObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId))
{
EventManager.TriggerParcelPrimCountTainted();
}
break;
}
else
{
// We also need to check the children of this prim as they
// can be selected as well and send property information
bool foundPrim = false;
SceneObjectGroup sog = ent as SceneObjectGroup;
SceneObjectPart[] partList = sog.Parts;
foreach (SceneObjectPart part in partList)
{
if (part.LocalId == primLocalID)
{
part.GetProperties(remoteClient);
foundPrim = true;
break;
}
}
if (foundPrim)
break;
}
}
}
}