Entry.java 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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.multisell;
  16. import java.util.ArrayList;
  17. import java.util.List;
  18. /**
  19. *
  20. * @author DS
  21. *
  22. */
  23. public class Entry
  24. {
  25. protected int _entryId;
  26. protected boolean _stackable = true;
  27. protected List<Ingredient> _products;
  28. protected List<Ingredient> _ingredients;
  29. public Entry(int entryId)
  30. {
  31. _entryId = entryId;
  32. _products = new ArrayList<Ingredient>();
  33. _ingredients = new ArrayList<Ingredient>();
  34. }
  35. /**
  36. * This constructor used in PreparedEntry only
  37. * ArrayLists not created
  38. */
  39. protected Entry()
  40. {
  41. }
  42. public final void setEntryId(int id)
  43. {
  44. _entryId = id;
  45. }
  46. public final int getEntryId()
  47. {
  48. return _entryId;
  49. }
  50. public final void addProduct(Ingredient product)
  51. {
  52. _products.add(product);
  53. if (!product.isStackable())
  54. _stackable = false;
  55. }
  56. public final List<Ingredient> getProducts()
  57. {
  58. return _products;
  59. }
  60. public final void addIngredient(Ingredient ingredient)
  61. {
  62. _ingredients.add(ingredient);
  63. }
  64. public final List<Ingredient> getIngredients()
  65. {
  66. return _ingredients;
  67. }
  68. public final boolean isStackable()
  69. {
  70. return _stackable;
  71. }
  72. public long getTaxAmount()
  73. {
  74. return 0;
  75. }
  76. }