InventoryItemBase.cs 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  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
  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 UUID _owner;
  53. private uint _nextPermissions;
  54. /// <summary>
  55. /// A mask containing permissions for the current owner (cannot be enforced)
  56. /// </summary>
  57. private uint _currentPermissions;
  58. /// <summary>
  59. /// The description of the inventory item (must be less than 64 characters)
  60. /// </summary>
  61. private string _description;
  62. /// <summary>
  63. ///
  64. /// </summary>
  65. private uint _everyOnePermissions;
  66. /// <summary>
  67. ///
  68. /// </summary>
  69. private uint _groupPermissions;
  70. /// <summary>
  71. /// The folder this item is contained in
  72. /// </summary>
  73. private UUID _folder;
  74. /// <summary>
  75. /// A UUID containing the ID for the inventory item itself
  76. /// </summary>
  77. private UUID _id;
  78. /// <summary>
  79. /// The type of inventory item. (Can be slightly different to the asset type
  80. /// </summary>
  81. private int _invType;
  82. /// <summary>
  83. /// The name of the inventory item (must be less than 64 characters)
  84. /// </summary>
  85. private string _name;
  86. /// <summary>
  87. ///
  88. /// </summary>
  89. private UUID _groupID;
  90. /// <summary>
  91. ///
  92. /// </summary>
  93. private bool _groupOwned;
  94. /// <summary>
  95. ///
  96. /// </summary>
  97. private int _salePrice;
  98. /// <summary>
  99. ///
  100. /// </summary>
  101. private byte _saleType;
  102. /// <summary>
  103. ///
  104. /// </summary>
  105. private uint _flags;
  106. /// <summary>
  107. ///
  108. /// </summary>
  109. private int _creationDate;
  110. public UUID ID {
  111. get { return _id; }
  112. set { _id = value; }
  113. }
  114. public int InvType
  115. {
  116. get { return _invType; }
  117. set { _invType = value; }
  118. }
  119. public UUID Folder
  120. {
  121. get { return _folder; }
  122. set { _folder = value; }
  123. }
  124. public UUID Owner
  125. {
  126. get { return _owner; }
  127. set { _owner = value; }
  128. }
  129. public UUID Creator
  130. {
  131. get { return _creator; }
  132. set { _creator = value; }
  133. }
  134. public string Name
  135. {
  136. get { return _name; }
  137. set { _name = value; }
  138. }
  139. public string Description
  140. {
  141. get { return _description; }
  142. set { _description = value; }
  143. }
  144. public uint NextPermissions
  145. {
  146. get { return _nextPermissions; }
  147. set { _nextPermissions = value; }
  148. }
  149. public uint CurrentPermissions
  150. {
  151. get { return _currentPermissions; }
  152. set { _currentPermissions = value; }
  153. }
  154. public uint BasePermissions
  155. {
  156. get { return _basePermissions; }
  157. set { _basePermissions = value; }
  158. }
  159. public uint EveryOnePermissions
  160. {
  161. get { return _everyOnePermissions; }
  162. set { _everyOnePermissions = value; }
  163. }
  164. public uint GroupPermissions
  165. {
  166. get { return _groupPermissions; }
  167. set { _groupPermissions = value; }
  168. }
  169. public int AssetType
  170. {
  171. get { return _assetType; }
  172. set { _assetType = value; }
  173. }
  174. public UUID AssetID
  175. {
  176. get { return _assetID; }
  177. set { _assetID = value; }
  178. }
  179. public UUID GroupID
  180. {
  181. get { return _groupID; }
  182. set { _groupID = value; }
  183. }
  184. public bool GroupOwned
  185. {
  186. get { return _groupOwned; }
  187. set { _groupOwned = value; }
  188. }
  189. public int SalePrice
  190. {
  191. get { return _salePrice; }
  192. set { _salePrice = value; }
  193. }
  194. public byte SaleType
  195. {
  196. get { return _saleType; }
  197. set { _saleType = value; }
  198. }
  199. public uint Flags
  200. {
  201. get { return _flags; }
  202. set { _flags = value; }
  203. }
  204. public int CreationDate
  205. {
  206. get { return _creationDate; }
  207. set { _creationDate = value; }
  208. }
  209. public InventoryItemBase()
  210. {
  211. _creationDate = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
  212. }
  213. }
  214. }