From 509ec2637bd178c270106725297da7f6a1180096 Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Mon, 4 May 2009 15:02:14 +0000
Subject: * Refactor: Simplify InventoryFolderImpl. No functional change.
---
.../Communications/Cache/InventoryFolderImpl.cs | 4 +-
OpenSim/Framework/InventoryItemBase.cs | 231 ++++++---------------
2 files changed, 65 insertions(+), 170 deletions(-)
(limited to 'OpenSim/Framework')
diff --git a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs
index a625c7e..bc8437c 100644
--- a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs
+++ b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs
@@ -396,7 +396,7 @@ namespace OpenSim.Framework.Communications.Cache
}
///
- /// Return a copy of the list of child items in this folder
+ /// Return a copy of the list of child items in this folder. The items themselves are the originals.
///
public List RequestListOfItems()
{
@@ -416,7 +416,7 @@ namespace OpenSim.Framework.Communications.Cache
}
///
- /// Return a copy of the list of child folders in this folder.
+ /// Return a copy of the list of child folders in this folder. The folders themselves are the originals.
///
public List RequestListOfFolders()
{
diff --git a/OpenSim/Framework/InventoryItemBase.cs b/OpenSim/Framework/InventoryItemBase.cs
index ae3777c..ce3dc63 100644
--- a/OpenSim/Framework/InventoryItemBase.cs
+++ b/OpenSim/Framework/InventoryItemBase.cs
@@ -34,219 +34,114 @@ namespace OpenSim.Framework
/// Inventory Item - contains all the properties associated with an individual inventory piece.
///
public class InventoryItemBase : InventoryNodeBase
- {
+ {
///
- /// The UUID of the associated asset on the asset server
- ///
- private UUID _assetID;
-
- ///
- /// This is an enumerated value determining the type of asset (eg Notecard, Sound, Object, etc)
- ///
- private int _assetType;
+ /// The inventory type of the item. This is slightly different from the asset type in some situations.
+ ///
+ public int InvType;
///
- ///
- ///
- private uint _basePermissions;
+ /// The folder this item is contained in
+ ///
+ public UUID Folder;
- ///
+ ///
/// The creator of this item
- ///
- private string m_creatorId = String.Empty;
+ ///
+ public string CreatorId
+ {
+ get { return m_creatorId; }
+ set
+ {
+ m_creatorId = value;
+ UUID creatorIdAsUuid;
+
+ // For now, all IDs are UUIDs
+ UUID.TryParse(m_creatorId, out creatorIdAsUuid);
+ CreatorIdAsUuid = creatorIdAsUuid;
+ }
+ }
+
+ private string m_creatorId = String.Empty;
- ///
+ ///
/// The creator of this item expressed as a UUID
- ///
- private UUID m_creatorIdAsUuid = UUID.Zero;
+ ///
+ public UUID CreatorIdAsUuid { get; private set; }
///
+ /// The description of the inventory item (must be less than 64 characters)
+ ///
+ public string Description = String.Empty;
+
+ ///
///
- ///
- private uint _nextPermissions;
+ ///
+ public uint NextPermissions;
///
/// A mask containing permissions for the current owner (cannot be enforced)
- ///
- private uint _currentPermissions;
+ ///
+ public uint CurrentPermissions;
///
- /// The description of the inventory item (must be less than 64 characters)
- ///
- private string _description = string.Empty;
+ ///
+ ///
+ public uint BasePermissions;
///
///
- ///
- private uint _everyOnePermissions;
-
+ ///
+ public uint EveryOnePermissions;
+
///
///
- ///
- private uint _groupPermissions;
+ ///
+ public uint GroupPermissions;
///
- /// The folder this item is contained in
- ///
- private UUID _folder;
+ /// This is an enumerated value determining the type of asset (eg Notecard, Sound, Object, etc)
+ ///
+ public int AssetType;
///
- /// The inventory type of the item. This is slightly different from the asset type in some situations.
- ///
- private int _invType;
+ /// The UUID of the associated asset on the asset server
+ ///
+ public UUID AssetID;
///
///
- ///
- private UUID _groupID;
+ ///
+ public UUID GroupID;
///
///
- ///
- private bool _groupOwned;
+ ///
+ public bool GroupOwned;
///
///
- ///
- private int _salePrice;
+ ///
+ public int SalePrice;
///
///
- ///
- private byte _saleType;
+ ///
+ public byte SaleType;
///
///
- ///
- private uint _flags;
+ ///
+ public uint Flags;
///
///
- ///
- private int _creationDate;
-
- public int InvType
- {
- get { return _invType; }
- set { _invType = value; }
- }
-
- public UUID Folder
- {
- get { return _folder; }
- set { _folder = value; }
- }
-
- ///
- /// The creator ID
- ///
- public string CreatorId
- {
- get { return m_creatorId; }
- set
- {
- m_creatorId = value;
-
- // For now, all IDs are UUIDs
- UUID.TryParse(m_creatorId, out m_creatorIdAsUuid);
- }
- }
-
- ///
- /// The creator ID expressed as a UUID
- ///
- public UUID CreatorIdAsUuid
- {
- get { return m_creatorIdAsUuid; }
- }
-
- public string Description
- {
- get { return _description; }
- set { _description = value; }
- }
-
- public uint NextPermissions
- {
- get { return _nextPermissions; }
- set { _nextPermissions = value; }
- }
-
- public uint CurrentPermissions
- {
- get { return _currentPermissions; }
- set { _currentPermissions = value; }
- }
-
- public uint BasePermissions
- {
- get { return _basePermissions; }
- set { _basePermissions = value; }
- }
-
- public uint EveryOnePermissions
- {
- get { return _everyOnePermissions; }
- set { _everyOnePermissions = value; }
- }
-
- public uint GroupPermissions
- {
- get { return _groupPermissions; }
- set { _groupPermissions = value; }
- }
-
- public int AssetType
- {
- get { return _assetType; }
- set { _assetType = value; }
- }
-
- public UUID AssetID
- {
- get { return _assetID; }
- set { _assetID = value; }
- }
-
- public UUID GroupID
- {
- get { return _groupID; }
- set { _groupID = value; }
- }
-
- public bool GroupOwned
- {
- get { return _groupOwned; }
- set { _groupOwned = value; }
- }
-
- public int SalePrice
- {
- get { return _salePrice; }
- set { _salePrice = value; }
- }
-
- public byte SaleType
- {
- get { return _saleType; }
- set { _saleType = value; }
- }
-
- public uint Flags
- {
- get { return _flags; }
- set { _flags = value; }
- }
-
- public int CreationDate
- {
- get { return _creationDate; }
- set { _creationDate = value; }
- }
+ ///
+ public int CreationDate;
public InventoryItemBase()
{
- _creationDate = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
+ CreationDate = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
}
}
}
--
cgit v1.1