...
1--[[ Galaxy
2
3 Automatically generated by the FlatBuffers compiler, do not modify.
4 Or modify. I'm a message, not a cop.
5
6 flatc version: 23.5.9
7
8 Declared by : //basic.fbs
9 Rooting type : Universe (//basic.fbs)
10
11--]]
12
13local flatbuffers = require('flatbuffers')
14
15local Galaxy = {}
16local mt = {}
17
18function Galaxy.New()
19 local o = {}
20 setmetatable(o, {__index = mt})
21 return o
22end
23
24function mt:Init(buf, pos)
25 self.view = flatbuffers.view.New(buf, pos)
26end
27
28function mt:NumStars()
29 local o = self.view:Offset(4)
30 if o ~= 0 then
31 return self.view:Get(flatbuffers.N.Int64, self.view.pos + o)
32 end
33 return 0
34end
35
36function Galaxy.Start(builder)
37 builder:StartObject(1)
38end
39
40function Galaxy.AddNumStars(builder, numStars)
41 builder:PrependInt64Slot(0, numStars, 0)
42end
43
44function Galaxy.End(builder)
45 return builder:EndObject()
46end
47
48return Galaxy
View as plain text