diff options
author | Justin Clark-Casey (justincc) | 2011-03-23 22:29:27 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-03-23 22:29:27 +0000 |
commit | de88227bc486788197b3a7c842c8b60f82b0a29b (patch) | |
tree | e48342e8a2d2096cf0355eea92dbf68805ad1e77 /OpenSim/Tests | |
parent | use a 3 part object for the pcm test rather than a 1 part, for improved test ... (diff) | |
download | opensim-SC_OLD-de88227bc486788197b3a7c842c8b60f82b0a29b.zip opensim-SC_OLD-de88227bc486788197b3a7c842c8b60f82b0a29b.tar.gz opensim-SC_OLD-de88227bc486788197b3a7c842c8b60f82b0a29b.tar.bz2 opensim-SC_OLD-de88227bc486788197b3a7c842c8b60f82b0a29b.tar.xz |
refactor: simplify part of AddSceneObject() test setup by moving sog construction into SceneSetupHelpers.CreateSceneObject()
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs index aa4b285..b7b7383 100644 --- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs +++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs | |||
@@ -465,5 +465,37 @@ namespace OpenSim.Tests.Common.Setup | |||
465 | 465 | ||
466 | return part; | 466 | return part; |
467 | } | 467 | } |
468 | |||
469 | /// <summary> | ||
470 | /// Create a scene object but do not add it to the scene. | ||
471 | /// </summary> | ||
472 | /// <remarks> | ||
473 | /// UUID always starts at 00000000-0000-0000-0000-000000000001 | ||
474 | /// </remarks> | ||
475 | /// <param name="parts">The number of parts that should be in the scene object</param> | ||
476 | /// <param name="ownerId"></param> | ||
477 | /// <returns></returns> | ||
478 | public static SceneObjectGroup CreateSceneObject(int parts, UUID ownerId) | ||
479 | { | ||
480 | SceneObjectPart rootPart | ||
481 | = new SceneObjectPart(ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) | ||
482 | { Name = "part1", UUID = new UUID("00000000-0000-0000-0000-000000000001") }; | ||
483 | SceneObjectGroup sog = new SceneObjectGroup(rootPart); | ||
484 | |||
485 | if (parts > 1) | ||
486 | { | ||
487 | for (int i = 2; i <= parts; i++) | ||
488 | { | ||
489 | sog.AddPart( | ||
490 | new SceneObjectPart(ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) | ||
491 | { | ||
492 | Name = string.Format("obj{0}", i), | ||
493 | UUID = new UUID(string.Format("00000000-0000-0000-0000-{0:D12}", i)) | ||
494 | }); | ||
495 | } | ||
496 | } | ||
497 | |||
498 | return sog; | ||
499 | } | ||
468 | } | 500 | } |
469 | } | 501 | } |