blob: 74217cc7e648c1bded575cd10370b61e3570ffae [file] [log] [blame]
James Kuszmaul8e62b022022-03-22 09:33:25 -07001--[[ MyGame.Example.Test
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
Austin Schuh2dd86a92022-09-14 21:19:23 -07006 flatc version: 2.0.8
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 Test = {}
16local mt = {}
Austin Schuhe89fa2d2019-08-14 20:24:23 -070017
18function Test.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
23
James Kuszmaul8e62b022022-03-22 09:33:25 -070024function mt:Init(buf, pos)
25 self.view = flatbuffers.view.New(buf, pos)
26end
27
28function mt:A()
29 return self.view:Get(flatbuffers.N.Int16, self.view.pos + 0)
30end
31
32function mt:B()
33 return self.view:Get(flatbuffers.N.Int8, self.view.pos + 2)
34end
35
36function Test.CreateTest(builder, a, b)
37 builder:Prep(2, 4)
38 builder:Pad(1)
39 builder:PrependInt8(b)
40 builder:PrependInt16(a)
41 return builder:Offset()
42end
43
44return Test