Entry.java 1.9 KB

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