summaryrefslogtreecommitdiff
path: root/inv_utils.lua
diff options
context:
space:
mode:
Diffstat (limited to 'inv_utils.lua')
-rw-r--r--inv_utils.lua10
1 files changed, 9 insertions, 1 deletions
diff --git a/inv_utils.lua b/inv_utils.lua
index 830e39e..872647d 100644
--- a/inv_utils.lua
+++ b/inv_utils.lua
@@ -1,3 +1,11 @@
+local function hasItemsInStorage(storage)
+ for _, _ in pairs(storage.list()) do
+ return true
+ end
+
+ return false
+end
+
local function getEmptySlotInStorage(storage)
return 5 -- TODO
end
@@ -10,4 +18,4 @@ local function swapSlotsInStorage(storage, slotA, slotB)
end
-return { swapSlotsInStorage = swapSlotsInStorage }
+return { hasItemsInStorage = hasItemsInStorage, swapSlotsInStorage = swapSlotsInStorage }