Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 1 | -- automatically generated by the FlatBuffers compiler, do not modify |
| 2 | |
| 3 | -- namespace: Example |
| 4 | |
| 5 | local flatbuffers = require('flatbuffers') |
| 6 | |
| 7 | local Ability = {} -- the module |
| 8 | local Ability_mt = {} -- the class metatable |
| 9 | |
| 10 | function Ability.New() |
| 11 | local o = {} |
| 12 | setmetatable(o, {__index = Ability_mt}) |
| 13 | return o |
| 14 | end |
| 15 | function Ability_mt:Init(buf, pos) |
| 16 | self.view = flatbuffers.view.New(buf, pos) |
| 17 | end |
| 18 | function Ability_mt:Id() |
| 19 | return self.view:Get(flatbuffers.N.Uint32, self.view.pos + 0) |
| 20 | end |
| 21 | function Ability_mt:Distance() |
| 22 | return self.view:Get(flatbuffers.N.Uint32, self.view.pos + 4) |
| 23 | end |
| 24 | function Ability.CreateAbility(builder, id, distance) |
| 25 | builder:Prep(4, 8) |
| 26 | builder:PrependUint32(distance) |
| 27 | builder:PrependUint32(id) |
| 28 | return builder:Offset() |
| 29 | end |
| 30 | |
| 31 | return Ability -- return the module |