James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 1 | --[[ MyGame.Example.StructOfStructs |
| 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 : //monster_test.fbs |
| 9 | Rooting type : MyGame.Example.Monster (//monster_test.fbs) |
| 10 | |
| 11 | --]] |
| 12 | |
| 13 | local flatbuffers = require('flatbuffers') |
| 14 | |
| 15 | local StructOfStructs = {} |
| 16 | local mt = {} |
| 17 | |
| 18 | function StructOfStructs.New() |
| 19 | local o = {} |
| 20 | setmetatable(o, {__index = mt}) |
| 21 | return o |
| 22 | end |
| 23 | |
| 24 | function mt:Init(buf, pos) |
| 25 | self.view = flatbuffers.view.New(buf, pos) |
| 26 | end |
| 27 | |
| 28 | function mt:A(obj) |
| 29 | obj:Init(self.view.bytes, self.view.pos + 0) |
| 30 | return obj |
| 31 | end |
| 32 | |
| 33 | function mt:B(obj) |
| 34 | obj:Init(self.view.bytes, self.view.pos + 8) |
| 35 | return obj |
| 36 | end |
| 37 | |
| 38 | function mt:C(obj) |
| 39 | obj:Init(self.view.bytes, self.view.pos + 12) |
| 40 | return obj |
| 41 | end |
| 42 | |
| 43 | function StructOfStructs.CreateStructOfStructs(builder, a_id, a_distance, b_a, b_b, c_id, c_distance) |
| 44 | builder:Prep(4, 20) |
| 45 | builder:Prep(4, 8) |
| 46 | builder:PrependUint32(c_distance) |
| 47 | builder:PrependUint32(c_id) |
| 48 | builder:Prep(2, 4) |
| 49 | builder:Pad(1) |
| 50 | builder:PrependInt8(b_b) |
| 51 | builder:PrependInt16(b_a) |
| 52 | builder:Prep(4, 8) |
| 53 | builder:PrependUint32(a_distance) |
| 54 | builder:PrependUint32(a_id) |
| 55 | return builder:Offset() |
| 56 | end |
| 57 | |
| 58 | return StructOfStructs |