Zepha/res/lua/util.lua
aurailus 4078e29440 Refactor the Lua code for the default game.
* Split the models and block definitions into two folders
* Gave some models more generic names
2019-04-21 15:25:06 -07:00

20 lines
598 B
Lua

-- Dump function
function dump(tbl, indent)
if not indent then indent = 0 end
for k, v in pairs(tbl) do
if type(k) == "number" then
k = "[" .. k .. "]"
end
local indentString = string.rep(" ", indent)
local formatting = indentString .. k .. " = "
if type(v) == "table" then
print(formatting .. "{")
dump(v, indent+1)
print(indentString .. "}")
elseif type(v) == 'boolean' then
print(formatting .. tostring(v))
else
print(formatting .. v)
end
end
end