From 865ae5c6f77133a1ca0107cb6c244838304e2e0e Mon Sep 17 00:00:00 2001 From: David McMackins II Date: Mon, 3 Oct 2016 12:39:51 -0500 Subject: Add refreshing to inventory item editor --- src/com/delwink/icebox/Inventory.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/com/delwink/icebox/Inventory.java b/src/com/delwink/icebox/Inventory.java index bd6a574..698c934 100644 --- a/src/com/delwink/icebox/Inventory.java +++ b/src/com/delwink/icebox/Inventory.java @@ -201,6 +201,10 @@ public class Inventory { ITEMS.put(item.getID(), item); } + public void deleteItem(int id) { + ITEMS.remove(id); + } + public Collection getItems() { return ITEMS.values(); } @@ -218,10 +222,6 @@ public class Inventory { if (ITEMS.isEmpty()) return 0; -// for (Integer id : ITEMS.keySet()) -// if (!ITEMS.containsKey(id + 1)) -// return id + 1; - throw new IllegalStateException("Could not find next item ID"); } } -- cgit v1.2.3