31 using OpenSim.Framework;
32 using OpenSim.Region.Framework.Scenes;
35 using OpenMetaverse.Assets;
37 namespace OpenSim.
Region.OptionalModules.Scripting.Minimodule
46 m_rootScene = rootScene;
47 m_privateItem = internalItem;
69 internal static InventoryItem FromInterface(IInventoryItem i)
71 if (typeof(InventoryItem).IsAssignableFrom(i.GetType()))
73 return (InventoryItem)i;
77 throw new ApplicationException(
"[MRM] There is no legal conversion from IInventoryItem to InventoryItem");
81 public int Type {
get {
return m_privateItem.Type; } }
82 public UUID AssetID {
get {
return m_privateItem.AssetID; } }
85 public T RetrieveAsset<T>() where T : OpenMetaverse.Assets.Asset,
new()
87 AssetBase a = m_rootScene.AssetService.Get(AssetID.ToString());
90 if ((sbyte)result.AssetType != a.
Type)
91 throw new ApplicationException(
"[MRM] The supplied asset class does not match the found asset");
93 result.AssetData = a.Data;
InventoryItem(Scene rootScene, TaskInventoryItem internalItem)
Represents an item in a task inventory
sbyte Type
(sbyte) AssetType enum
Asset class. All Assets are reference by this class or a class derived from this class ...
This implements the methods needed to operate on individual inventory items.