InventoryItemBase.cs 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. /*
  2. * Copyright (c) Contributors, http://opensimulator.org/
  3. * See CONTRIBUTORS.TXT for a full list of copyright holders.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. * * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * * Neither the name of the OpenSim Project nor the
  13. * names of its contributors may be used to endorse or promote products
  14. * derived from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
  17. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  18. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
  20. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  21. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  22. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  23. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. using System;
  28. using OpenMetaverse;
  29. namespace OpenSim.Framework
  30. {
  31. /// <summary>
  32. /// Inventory Item - contains all the properties associated with an individual inventory piece.
  33. /// </summary>
  34. public class InventoryItemBase : InventoryNodeBase
  35. {
  36. /// <summary>
  37. /// The UUID of the associated asset on the asset server
  38. /// </summary>
  39. private UUID _assetID;
  40. /// <summary>
  41. /// This is an enumerated value determining the type of asset (eg Notecard, Sound, Object, etc)
  42. /// </summary>
  43. private int _assetType;
  44. /// <summary>
  45. ///
  46. /// </summary>
  47. private uint _basePermissions;
  48. /// <summary>
  49. /// The creator of this item
  50. /// </summary>
  51. private UUID _creator;
  52. private uint _nextPermissions;
  53. /// <summary>
  54. /// A mask containing permissions for the current owner (cannot be enforced)
  55. /// </summary>
  56. private uint _currentPermissions;
  57. /// <summary>
  58. /// The description of the inventory item (must be less than 64 characters)
  59. /// </summary>
  60. private string _description = string.Empty;
  61. /// <summary>
  62. ///
  63. /// </summary>
  64. private uint _everyOnePermissions;
  65. /// <summary>
  66. ///
  67. /// </summary>
  68. private uint _groupPermissions;
  69. /// <summary>
  70. /// The folder this item is contained in
  71. /// </summary>
  72. private UUID _folder;
  73. /// <summary>
  74. /// The inventory type of the item. This is slightly different from the asset type in some situations.
  75. /// </summary>
  76. private int _invType;
  77. /// <summary>
  78. ///
  79. /// </summary>
  80. private UUID _groupID;
  81. /// <summary>
  82. ///
  83. /// </summary>
  84. private bool _groupOwned;
  85. /// <summary>
  86. ///
  87. /// </summary>
  88. private int _salePrice;
  89. /// <summary>
  90. ///
  91. /// </summary>
  92. private byte _saleType;
  93. /// <summary>
  94. ///
  95. /// </summary>
  96. private uint _flags;
  97. /// <summary>
  98. ///
  99. /// </summary>
  100. private int _creationDate;
  101. public int InvType
  102. {
  103. get { return _invType; }
  104. set { _invType = value; }
  105. }
  106. public UUID Folder
  107. {
  108. get { return _folder; }
  109. set { _folder = value; }
  110. }
  111. public UUID Creator
  112. {
  113. get { return _creator; }
  114. set { _creator = value; }
  115. }
  116. public string Description
  117. {
  118. get { return _description; }
  119. set { _description = value; }
  120. }
  121. public uint NextPermissions
  122. {
  123. get { return _nextPermissions; }
  124. set { _nextPermissions = value; }
  125. }
  126. public uint CurrentPermissions
  127. {
  128. get { return _currentPermissions; }
  129. set { _currentPermissions = value; }
  130. }
  131. public uint BasePermissions
  132. {
  133. get { return _basePermissions; }
  134. set { _basePermissions = value; }
  135. }
  136. public uint EveryOnePermissions
  137. {
  138. get { return _everyOnePermissions; }
  139. set { _everyOnePermissions = value; }
  140. }
  141. public uint GroupPermissions
  142. {
  143. get { return _groupPermissions; }
  144. set { _groupPermissions = value; }
  145. }
  146. public int AssetType
  147. {
  148. get { return _assetType; }
  149. set { _assetType = value; }
  150. }
  151. public UUID AssetID
  152. {
  153. get { return _assetID; }
  154. set { _assetID = value; }
  155. }
  156. public UUID GroupID
  157. {
  158. get { return _groupID; }
  159. set { _groupID = value; }
  160. }
  161. public bool GroupOwned
  162. {
  163. get { return _groupOwned; }
  164. set { _groupOwned = value; }
  165. }
  166. public int SalePrice
  167. {
  168. get { return _salePrice; }
  169. set { _salePrice = value; }
  170. }
  171. public byte SaleType
  172. {
  173. get { return _saleType; }
  174. set { _saleType = value; }
  175. }
  176. public uint Flags
  177. {
  178. get { return _flags; }
  179. set { _flags = value; }
  180. }
  181. public int CreationDate
  182. {
  183. get { return _creationDate; }
  184. set { _creationDate = value; }
  185. }
  186. public InventoryItemBase()
  187. {
  188. _creationDate = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
  189. }
  190. }
  191. }