91807870fe
move several functions into the api. fix root growth directions. clean up root and grass growth code.
17 lines
296 B
Lua
17 lines
296 B
Lua
function blockgame.get_keys (tab)
|
|
local keyset = {}
|
|
local n = 0
|
|
for key, value in pairs(tab) do
|
|
n = n + 1
|
|
keyset[n] = key
|
|
end
|
|
return keyset
|
|
end
|
|
|
|
function blockgame.shallow_copy_table (tab)
|
|
local result = {}
|
|
for key, value in pairs(tab) do
|
|
result[key] = value
|
|
end
|
|
return result
|
|
end
|