TempItem.java 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. import com.l2jserver.gameserver.model.item.instance.L2ItemInstance;
  17. /**
  18. * Class explanation:<br>
  19. * For item counting or checking purposes. When you don't want to modify inventory<br>
  20. * class contains itemId, quantity, ownerId, referencePrice, but not objectId<br>
  21. * is stored, this will be only "list" of items with it's owner
  22. */
  23. public final class TempItem
  24. {
  25. private int _itemId;
  26. private int _quantity;
  27. private int _referencePrice;
  28. private String _itemName;
  29. /**
  30. * @param item
  31. * @param quantity of that item
  32. */
  33. public TempItem(L2ItemInstance item, int quantity)
  34. {
  35. super();
  36. _itemId = item.getItemId();
  37. _quantity = quantity;
  38. _itemName = item.getItem().getName();
  39. _referencePrice = item.getReferencePrice();
  40. }
  41. /**
  42. * @return the quantity.
  43. */
  44. public int getQuantity()
  45. {
  46. return _quantity;
  47. }
  48. /**
  49. * @param quantity The quantity to set.
  50. */
  51. public void setQuantity(int quantity)
  52. {
  53. _quantity = quantity;
  54. }
  55. public int getReferencePrice()
  56. {
  57. return _referencePrice;
  58. }
  59. /**
  60. * @return the itemId.
  61. */
  62. public int getItemId()
  63. {
  64. return _itemId;
  65. }
  66. /**
  67. * @return the itemName.
  68. */
  69. public String getItemName()
  70. {
  71. return _itemName;
  72. }
  73. }