James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 1 | --[[ TableA |
| 2 | |
| 3 | Automatically generated by the FlatBuffers compiler, do not modify. |
| 4 | Or modify. I'm a message, not a cop. |
| 5 | |
James Kuszmaul | 3b15b0c | 2022-11-08 14:03:16 -0800 | [diff] [blame^] | 6 | flatc version: 22.10.26 |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 7 | |
| 8 | Declared by : //include_test/include_test1.fbs |
| 9 | Rooting type : MyGame.Example.Monster (//monster_test.fbs) |
| 10 | |
| 11 | --]] |
| 12 | |
| 13 | local __MyGame_OtherNameSpace_TableB = require('MyGame.OtherNameSpace.TableB') |
| 14 | local flatbuffers = require('flatbuffers') |
| 15 | |
| 16 | local TableA = {} |
| 17 | local mt = {} |
| 18 | |
| 19 | function TableA.New() |
| 20 | local o = {} |
| 21 | setmetatable(o, {__index = mt}) |
| 22 | return o |
| 23 | end |
| 24 | |
| 25 | function mt:Init(buf, pos) |
| 26 | self.view = flatbuffers.view.New(buf, pos) |
| 27 | end |
| 28 | |
| 29 | function mt:B() |
| 30 | local o = self.view:Offset(4) |
| 31 | if o ~= 0 then |
| 32 | local x = self.view:Indirect(self.view.pos + o) |
| 33 | local obj = __MyGame_OtherNameSpace_TableB.New() |
| 34 | obj:Init(self.view.bytes, x) |
| 35 | return obj |
| 36 | end |
| 37 | end |
| 38 | |
| 39 | function TableA.Start(builder) |
| 40 | builder:StartObject(1) |
| 41 | end |
| 42 | |
| 43 | function TableA.AddB(builder, b) |
| 44 | builder:PrependStructSlot(0, b, 0) |
| 45 | end |
| 46 | |
| 47 | function TableA.End(builder) |
| 48 | return builder:EndObject() |
| 49 | end |
| 50 | |
| 51 | return TableA |