diff options
author | David McMackins II <contact@mcmackins.org> | 2016-12-01 08:39:23 -0600 |
---|---|---|
committer | David McMackins II <contact@mcmackins.org> | 2016-12-01 08:39:23 -0600 |
commit | d6af34bb7a737ecc3b4c4cca30e2df2bde07841d (patch) | |
tree | db679c4c77aea876d062f611ae5116e21ddd2992 /src/com/delwink/icebox/Inventory.java | |
parent | 836ab01b6f372b35aecec4e17656a2232388783a (diff) |
Diffstat (limited to 'src/com/delwink/icebox/Inventory.java')
-rw-r--r-- | src/com/delwink/icebox/Inventory.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/com/delwink/icebox/Inventory.java b/src/com/delwink/icebox/Inventory.java index 019b015..3e15549 100644 --- a/src/com/delwink/icebox/Inventory.java +++ b/src/com/delwink/icebox/Inventory.java @@ -177,6 +177,9 @@ public class Inventory { writer.flush(); } + /** + * Refreshes the quantities of items in stock based on orders and updates. + */ public void refreshQuantities() { for (InventoryItem item : ITEMS.values()) item.addStock(-item.getStock()); // clear stock before refreshing @@ -192,6 +195,10 @@ public class Inventory { addUpdate(update); } + /** + * Adds an order to this inventory stock. + * @param order The order to be added. + */ public final void addOrder(Order order) { ORDERS.add(order); @@ -208,6 +215,10 @@ public class Inventory { return ORDERS; } + /** + * Adds a quantity update to this inventory's stock. + * @param update The update to be added. + */ public final void addUpdate(QuantityUpdate update) { UPDATES.add(update); @@ -240,6 +251,10 @@ public class Inventory { return ITEMS.get(id); } + /** + * Finds the next unused item ID. + * @return The next available item ID for use. + */ public int getNextID() { Set<Integer> keys = ITEMS.keySet(); for (int i = 0; i <= keys.size(); ++i) |