mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 17:55:48 +08:00
Add PrimCountModuleTests.TestRemoveOwnerObject().
Also adds SceneSetupHelpers methods to easily create sogs with different part UUIDs
This commit is contained in:
@@ -488,20 +488,37 @@ namespace OpenSim.Tests.Common.Setup
|
||||
/// <param name="ownerId"></param>
|
||||
/// <returns></returns>
|
||||
public static SceneObjectGroup CreateSceneObject(int parts, UUID ownerId)
|
||||
{
|
||||
{
|
||||
return CreateSceneObject(parts, ownerId, 0x1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a scene object but do not add it to the scene.
|
||||
/// </summary>
|
||||
/// <param name="parts">The number of parts that should be in the scene object</param>
|
||||
/// <param name="ownerId"></param>
|
||||
/// <param name="uuidTail">
|
||||
/// The hexadecimal last part of the UUID for parts created. A UUID of the form "00000000-0000-0000-0000-{0:XD12}"
|
||||
/// will be given to the root part, and incremented for each part thereafter.
|
||||
/// </param>
|
||||
/// <returns></returns>
|
||||
public static SceneObjectGroup CreateSceneObject(int parts, UUID ownerId, int uuidTail)
|
||||
{
|
||||
string rawSogId = string.Format("00000000-0000-0000-0000-{0:X12}", uuidTail);
|
||||
|
||||
SceneObjectGroup sog
|
||||
= new SceneObjectGroup(
|
||||
CreateSceneObjectPart("part1", new UUID("00000000-0000-0000-0000-000000000001"), ownerId));
|
||||
CreateSceneObjectPart("part0", new UUID(rawSogId), ownerId));
|
||||
|
||||
if (parts > 1)
|
||||
for (int i = 2; i <= parts; i++)
|
||||
for (int i = 1; i < parts; i++)
|
||||
sog.AddPart(
|
||||
CreateSceneObjectPart(
|
||||
string.Format("obj{0}", i),
|
||||
new UUID(string.Format("00000000-0000-0000-0000-{0:D12}", i)),
|
||||
new UUID(string.Format("00000000-0000-0000-0000-{0:X12}", uuidTail + i)),
|
||||
ownerId));
|
||||
|
||||
return sog;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user