diff --git a/sonic-radiance.love/birb/utils/table.lua b/sonic-radiance.love/birb/utils/table.lua index 3e859cb..a65e109 100644 --- a/sonic-radiance.love/birb/utils/table.lua +++ b/sonic-radiance.love/birb/utils/table.lua @@ -52,10 +52,26 @@ function Table.toString(table) return string .. "}" end +function Table.clone(table1) + local returnTable = {} + for key, value in pairs(table1) do + returnTable[key] = value + end + return returnTable +end + function Table.mergeList(table1, table2) for i, value in ipairs(table2) do table.insert(table1, value) end + return table1 +end + +function Table.merge(table1, table2) + for key, value in pairs(table2) do + table1[key] = value + end + return table1 end function Table.reduce(list, fn)