cc-utilities/storage/sentinel.lua
2024-10-12 07:34:57 +02:00

19 lines
349 B
Lua

local TABLE_KEY = "!__SENTINEL"
local Sentinel = {
CHEST = "CHEST",
ITEMSTACK = "ITEMSTACK",
ITEMGROUP = "ITEMGROUP",
STORAGE = "STORAGE"
}
function Sentinel:tag(table, sentinel)
table[TABLE_KEY] = sentinel
return table
end
function Sentinel:is(table, sentinel)
return table[TABLE_KEY] == sentinel
end
return Sentinel