InventoryItemBase.cs 6.5 KB

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