Add ringbuffer.deserialize
This commit is contained in:
parent
871cfd3a77
commit
5d8f0b606e
@ -42,4 +42,9 @@ function ringbuffer_class:serialize()
|
||||
return minetest.serialize(self.data)
|
||||
end
|
||||
|
||||
function ringbuffer.deserialize(size, serialized_data)
|
||||
local rb_data = minetest.deserialize(serialized_data)
|
||||
return rb_data and ringbuffer.new(size, rb_data)
|
||||
end
|
||||
|
||||
return setmetatable(ringbuffer, ringbuffer_class)
|
||||
|
Loading…
x
Reference in New Issue
Block a user