diff options
Diffstat (limited to 'core/src/util.lua')
-rw-r--r-- | core/src/util.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/core/src/util.lua b/core/src/util.lua index 9e3c7f25e..c7dba3196 100644 --- a/core/src/util.lua +++ b/core/src/util.lua @@ -73,6 +73,18 @@ function clone(object, deep) end +-- Combines two or more numerically indexed tables into one +function combine(...) + local result = {} + for i, a in ipairs(arg) do + for j, v in ipairs(a) do + table.insert(result, v) + end + end + return result +end + + -- Checks whether a table has an object "value" in it function contains(table, value) for k,v in pairs(table) do |