mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 05:51:51 +00:00
commit
c0364d4e5a
1 changed files with 17 additions and 3 deletions
|
|
@ -22,10 +22,24 @@ local TYPE_DOUBLE = 6
|
||||||
|
|
||||||
-- Data buffer
|
-- Data buffer
|
||||||
|
|
||||||
local data_buffer = { }
|
local data_buffer =
|
||||||
|
{
|
||||||
|
__call =
|
||||||
|
function(data_buffer, bytes)
|
||||||
|
return data_buffer:new(bytes)
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
function data_buffer.__call(bytes)
|
function data_buffer:new(bytes)
|
||||||
return setmetatable({ pos = 1, bytes = bytes or { } }, { __index = data_buffer })
|
local obj = {
|
||||||
|
pos = 1,
|
||||||
|
bytes = bytes or { }
|
||||||
|
}
|
||||||
|
|
||||||
|
self.__index = self
|
||||||
|
setmetatable(obj, self)
|
||||||
|
|
||||||
|
return obj
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Push functions
|
-- Push functions
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue