TempItem.java 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * This program is free software: you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation, either version 3 of the License, or (at your option) any later
  5. * version.
  6. *
  7. * This program is distributed in the hope that it will be useful, but WITHOUT
  8. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  10. * details.
  11. *
  12. * You should have received a copy of the GNU General Public License along with
  13. * this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. package com.l2jserver.gameserver.model;
  16. /**
  17. * Class explanation:<br>
  18. * For item counting or checking purposes. When you don't want to modify inventory<br>
  19. * class contains itemId, quantity, ownerId, referencePrice, but not objectId<br>
  20. * is stored, this will be only "list" of items with it's owner
  21. */
  22. public final class TempItem
  23. {
  24. private int _itemId;
  25. private int _quantity;
  26. private int _referencePrice;
  27. private String _itemName;
  28. /**
  29. * @param item
  30. * @param quantity of that item
  31. */
  32. public TempItem(L2ItemInstance item, int quantity)
  33. {
  34. super();
  35. _itemId = item.getItemId();
  36. _quantity = quantity;
  37. _itemName = item.getItem().getName();
  38. _referencePrice = item.getReferencePrice();
  39. }
  40. /**
  41. * @return the quantity.
  42. */
  43. public int getQuantity()
  44. {
  45. return _quantity;
  46. }
  47. /**
  48. * @param quantity The quantity to set.
  49. */
  50. public void setQuantity(int quantity)
  51. {
  52. _quantity = quantity;
  53. }
  54. public int getReferencePrice()
  55. {
  56. return _referencePrice;
  57. }
  58. /**
  59. * @return the itemId.
  60. */
  61. public int getItemId()
  62. {
  63. return _itemId;
  64. }
  65. /**
  66. * @return the itemName.
  67. */
  68. public String getItemName()
  69. {
  70. return _itemName;
  71. }
  72. }