blob: f3f8396bb24ec1170e54e0d324e7c5b0a6d3bbc7 [file] [log] [blame]
James Kuszmaul8e62b022022-03-22 09:33:25 -07001--[[ MyGame.Example.Referrable
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002
James Kuszmaul8e62b022022-03-22 09:33:25 -07003 Automatically generated by the FlatBuffers compiler, do not modify.
4 Or modify. I'm a message, not a cop.
5
James Kuszmaul3b15b0c2022-11-08 14:03:16 -08006 flatc version: 22.10.26
James Kuszmaul8e62b022022-03-22 09:33:25 -07007
8 Declared by : //monster_test.fbs
9 Rooting type : MyGame.Example.Monster (//monster_test.fbs)
10
11--]]
Austin Schuhe89fa2d2019-08-14 20:24:23 -070012
13local flatbuffers = require('flatbuffers')
14
James Kuszmaul8e62b022022-03-22 09:33:25 -070015local Referrable = {}
16local mt = {}
Austin Schuhe89fa2d2019-08-14 20:24:23 -070017
18function Referrable.New()
James Kuszmaul8e62b022022-03-22 09:33:25 -070019 local o = {}
20 setmetatable(o, {__index = mt})
21 return o
Austin Schuhe89fa2d2019-08-14 20:24:23 -070022end
Austin Schuhe89fa2d2019-08-14 20:24:23 -070023
James Kuszmaul8e62b022022-03-22 09:33:25 -070024function mt:Init(buf, pos)
25 self.view = flatbuffers.view.New(buf, pos)
26end
27
28function mt:Id()
29 local o = self.view:Offset(4)
30 if o ~= 0 then
31 return self.view:Get(flatbuffers.N.Uint64, self.view.pos + o)
32 end
33 return 0
34end
35
36function Referrable.Start(builder)
37 builder:StartObject(1)
38end
39
40function Referrable.AddId(builder, id)
41 builder:PrependUint64Slot(0, id, 0)
42end
43
44function Referrable.End(builder)
45 return builder:EndObject()
46end
47
48return Referrable