RepairTransaction.java 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. package com.gmail.nossr50.skills.repair;
  2. import java.util.HashSet;
  3. /**
  4. * Represents a complete "repair transaction"
  5. *
  6. * I will define a "repair transaction" as such
  7. * - The items used to pay the cost of repairing an item in mcMMO via the Repair Skill
  8. *
  9. * A single "RepairTransaction" is made up of a multiple RepairCost objects
  10. * No two RepairCosts contained within this type can be exact duplicates
  11. *
  12. * A RepairCost is used to find a matching ItemStack in a players inventory if one exists to pay its cost
  13. *
  14. * A RepairCost can be a single item or it can be multiple items representing a range of compatible items
  15. * to pay that part of the RepairTransaction
  16. */
  17. public class RepairTransaction {
  18. private HashSet<RepairCost> repairItems;
  19. public RepairTransaction() {
  20. repairItems = new HashSet<>();
  21. }
  22. public void addRepairCost(RepairCost repairCost) {
  23. repairItems.add(repairCost);
  24. }
  25. public HashSet<RepairCost> getRepairItems() {
  26. return repairItems;
  27. }
  28. public void setRepairItems(HashSet<RepairCost> repairItems) {
  29. this.repairItems = repairItems;
  30. }
  31. }