diff options
author | Justin Clark-Casey (justincc) | 2011-05-21 00:37:20 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-05-21 00:37:20 +0100 |
commit | 084059319c125983ac43534797282ddec394cb59 (patch) | |
tree | eec520169cf04dc35a8931941372ec543eef3388 /OpenSim/Tests | |
parent | move test task inventory notecard item creation into a new TastInventoryHelpe... (diff) | |
download | opensim-SC_OLD-084059319c125983ac43534797282ddec394cb59.zip opensim-SC_OLD-084059319c125983ac43534797282ddec394cb59.tar.gz opensim-SC_OLD-084059319c125983ac43534797282ddec394cb59.tar.bz2 opensim-SC_OLD-084059319c125983ac43534797282ddec394cb59.tar.xz |
refactor: move scene object item creation code into TaskInventoryHelpers
Diffstat (limited to 'OpenSim/Tests')
-rw-r--r-- | OpenSim/Tests/Common/Setup/TaskInventoryHelpers.cs | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/OpenSim/Tests/Common/Setup/TaskInventoryHelpers.cs b/OpenSim/Tests/Common/Setup/TaskInventoryHelpers.cs index 48724f4..4467573 100644 --- a/OpenSim/Tests/Common/Setup/TaskInventoryHelpers.cs +++ b/OpenSim/Tests/Common/Setup/TaskInventoryHelpers.cs | |||
@@ -32,7 +32,7 @@ using OpenSim.Framework; | |||
32 | using OpenSim.Region.Framework.Scenes; | 32 | using OpenSim.Region.Framework.Scenes; |
33 | using OpenSim.Services.Interfaces; | 33 | using OpenSim.Services.Interfaces; |
34 | 34 | ||
35 | namespace OpenSim.Tests.Common | 35 | namespace OpenSim.Tests.Common.Setup |
36 | { | 36 | { |
37 | /// <summary> | 37 | /// <summary> |
38 | /// Utility functions for carrying out task inventory tests. | 38 | /// Utility functions for carrying out task inventory tests. |
@@ -64,5 +64,26 @@ namespace OpenSim.Tests.Common | |||
64 | 64 | ||
65 | return ncItem; | 65 | return ncItem; |
66 | } | 66 | } |
67 | |||
68 | /// <summary> | ||
69 | /// Add a scene object item to the given part. | ||
70 | /// </summary> | ||
71 | /// <param name="scene"></param> | ||
72 | /// <param name="sop"></param> | ||
73 | /// <param name="itemName"></param> | ||
74 | /// <param name="id"></param> | ||
75 | public static TaskInventoryItem AddSceneObjectItem(Scene scene, SceneObjectPart sop, string itemName, UUID id) | ||
76 | { | ||
77 | SceneObjectGroup taskSceneObject = SceneSetupHelpers.CreateSceneObject(1, UUID.Zero); | ||
78 | AssetBase taskSceneObjectAsset = AssetHelpers.CreateAsset(0x10, taskSceneObject); | ||
79 | scene.AssetService.Store(taskSceneObjectAsset); | ||
80 | TaskInventoryItem taskSceneObjectItem | ||
81 | = new TaskInventoryItem | ||
82 | { Name = itemName, AssetID = taskSceneObjectAsset.FullID, ItemID = id, | ||
83 | Type = (int)AssetType.Object, InvType = (int)InventoryType.Object }; | ||
84 | sop.Inventory.AddInventoryItem(taskSceneObjectItem, true); | ||
85 | |||
86 | return taskSceneObjectItem; | ||
87 | } | ||
67 | } | 88 | } |
68 | } \ No newline at end of file | 89 | } \ No newline at end of file |