blob: 6947c0be908b92ea3e3128d34f6b4dfbc11fa876 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
serialize_meta = function(pos)
local insert, format, concat = table.insert, string.format, table.concat
--wip: do recursive serialize
local meta = env:get_meta(pos):to_table()
local fields = {}
for key, value in pairs(meta.fields) do
insert(fields, format("%q", key) .. format("%q", value))
end
return concat(meta.inventory, ",") .. concat(fields)
end
deserialize_meta = function(value)
--wip
end
|