• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1-- automatically generated by the FlatBuffers compiler, do not modify
2
3-- namespace: Example2
4
5local flatbuffers = require('flatbuffers')
6
7local Monster = {} -- the module
8local Monster_mt = {} -- the class metatable
9
10function Monster.New()
11    local o = {}
12    setmetatable(o, {__index = Monster_mt})
13    return o
14end
15function Monster.GetRootAsMonster(buf, offset)
16    if type(buf) == "string" then
17        buf = flatbuffers.binaryArray.New(buf)
18    end
19    local n = flatbuffers.N.UOffsetT:Unpack(buf, offset)
20    local o = Monster.New()
21    o:Init(buf, n + offset)
22    return o
23end
24function Monster_mt:Init(buf, pos)
25    self.view = flatbuffers.view.New(buf, pos)
26end
27function Monster.Start(builder) builder:StartObject(0) end
28function Monster.End(builder) return builder:EndObject() end
29
30return Monster -- return the module