mirror of
https://gitlab.com/hoggit/developers/hoggit.git
synced 2025-11-10 15:43:28 +00:00
Added stuff from TNN2 Hoggit Core to lib
This commit is contained in:
17
lib/utils.lua
Normal file
17
lib/utils.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
HOGGIT.filterTable = function(t, filter)
|
||||
local out = {}
|
||||
for k,v in pairs(t) do
|
||||
if filter(v) then out[k] = v end
|
||||
end
|
||||
return out
|
||||
end
|
||||
|
||||
HOGGIT.listContains = function(list, elem)
|
||||
for _, value in ipairs(list) do
|
||||
if value == elem then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
Reference in New Issue
Block a user