TempItem.java 2.0 KB

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