• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1--[[ MyGame.Example.Monster
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: 2.0.7
7
8  Declared by  : //monster_test.fbs
9  Rooting type : MyGame.Example.Monster (//monster_test.fbs)
10
11--]]
12
13local __MyGame_Example_Ability = require('MyGame.Example.Ability')
14local __MyGame_Example_Referrable = require('MyGame.Example.Referrable')
15local __MyGame_Example_Stat = require('MyGame.Example.Stat')
16local __MyGame_Example_Test = require('MyGame.Example.Test')
17local __MyGame_Example_Vec3 = require('MyGame.Example.Vec3')
18local __MyGame_InParentNamespace = require('MyGame.InParentNamespace')
19local flatbuffers = require('flatbuffers')
20
21-- an example documentation comment: "monster object"
22local Monster = {}
23local mt = {}
24
25function Monster.New()
26  local o = {}
27  setmetatable(o, {__index = mt})
28  return o
29end
30
31function Monster.GetRootAsMonster(buf, offset)
32  if type(buf) == "string" then
33    buf = flatbuffers.binaryArray.New(buf)
34  end
35
36  local n = flatbuffers.N.UOffsetT:Unpack(buf, offset)
37  local o = Monster.New()
38  o:Init(buf, n + offset)
39  return o
40end
41
42function mt:Init(buf, pos)
43  self.view = flatbuffers.view.New(buf, pos)
44end
45
46function mt:Pos()
47  local o = self.view:Offset(4)
48  if o ~= 0 then
49    local x = self.view.pos + o
50    local obj = __MyGame_Example_Vec3.New()
51    obj:Init(self.view.bytes, x)
52    return obj
53  end
54end
55
56function mt:Mana()
57  local o = self.view:Offset(6)
58  if o ~= 0 then
59    return self.view:Get(flatbuffers.N.Int16, self.view.pos + o)
60  end
61  return 150
62end
63
64function mt:Hp()
65  local o = self.view:Offset(8)
66  if o ~= 0 then
67    return self.view:Get(flatbuffers.N.Int16, self.view.pos + o)
68  end
69  return 100
70end
71
72function mt:Name()
73  local o = self.view:Offset(10)
74  if o ~= 0 then
75    return self.view:String(self.view.pos + o)
76  end
77end
78
79function mt:Inventory(j)
80  local o = self.view:Offset(14)
81  if o ~= 0 then
82    local a = self.view:Vector(o)
83    return self.view:Get(flatbuffers.N.Uint8, a + ((j-1) * 1))
84  end
85  return 0
86end
87
88function mt:InventoryAsString(start, stop)
89  return self.view:VectorAsString(14, start, stop)
90end
91
92function mt:InventoryLength()
93  local o = self.view:Offset(14)
94  if o ~= 0 then
95    return self.view:VectorLen(o)
96  end
97  return 0
98end
99
100function mt:Color()
101  local o = self.view:Offset(16)
102  if o ~= 0 then
103    return self.view:Get(flatbuffers.N.Uint8, self.view.pos + o)
104  end
105  return 8
106end
107
108function mt:TestType()
109  local o = self.view:Offset(18)
110  if o ~= 0 then
111    return self.view:Get(flatbuffers.N.Uint8, self.view.pos + o)
112  end
113  return 0
114end
115
116function mt:Test()
117  local o = self.view:Offset(20)
118  if o ~= 0 then
119   local obj = flatbuffers.view.New(flatbuffers.binaryArray.New(0), 0)
120    self.view:Union(obj, o)
121    return obj
122  end
123end
124
125function mt:Test4(j)
126  local o = self.view:Offset(22)
127  if o ~= 0 then
128    local x = self.view:Vector(o)
129    x = x + ((j-1) * 4)
130    local obj = __MyGame_Example_Test.New()
131    obj:Init(self.view.bytes, x)
132    return obj
133  end
134end
135
136function mt:Test4Length()
137  local o = self.view:Offset(22)
138  if o ~= 0 then
139    return self.view:VectorLen(o)
140  end
141  return 0
142end
143
144function mt:Testarrayofstring(j)
145  local o = self.view:Offset(24)
146  if o ~= 0 then
147    local a = self.view:Vector(o)
148    return self.view:String(a + ((j-1) * 4))
149  end
150  return ''
151end
152
153function mt:TestarrayofstringLength()
154  local o = self.view:Offset(24)
155  if o ~= 0 then
156    return self.view:VectorLen(o)
157  end
158  return 0
159end
160
161-- an example documentation comment: this will end up in the generated code
162-- multiline too
163function mt:Testarrayoftables(j)
164  local o = self.view:Offset(26)
165  if o ~= 0 then
166    local x = self.view:Vector(o)
167    x = x + ((j-1) * 4)
168    x = self.view:Indirect(x)
169    local obj = Monster.New()
170    obj:Init(self.view.bytes, x)
171    return obj
172  end
173end
174
175function mt:TestarrayoftablesLength()
176  local o = self.view:Offset(26)
177  if o ~= 0 then
178    return self.view:VectorLen(o)
179  end
180  return 0
181end
182
183function mt:Enemy()
184  local o = self.view:Offset(28)
185  if o ~= 0 then
186    local x = self.view:Indirect(self.view.pos + o)
187    local obj = Monster.New()
188    obj:Init(self.view.bytes, x)
189    return obj
190  end
191end
192
193function mt:Testnestedflatbuffer(j)
194  local o = self.view:Offset(30)
195  if o ~= 0 then
196    local a = self.view:Vector(o)
197    return self.view:Get(flatbuffers.N.Uint8, a + ((j-1) * 1))
198  end
199  return 0
200end
201
202function mt:TestnestedflatbufferAsString(start, stop)
203  return self.view:VectorAsString(30, start, stop)
204end
205
206function mt:TestnestedflatbufferLength()
207  local o = self.view:Offset(30)
208  if o ~= 0 then
209    return self.view:VectorLen(o)
210  end
211  return 0
212end
213
214function mt:Testempty()
215  local o = self.view:Offset(32)
216  if o ~= 0 then
217    local x = self.view:Indirect(self.view.pos + o)
218    local obj = __MyGame_Example_Stat.New()
219    obj:Init(self.view.bytes, x)
220    return obj
221  end
222end
223
224function mt:Testbool()
225  local o = self.view:Offset(34)
226  if o ~= 0 then
227    return (self.view:Get(flatbuffers.N.Bool, self.view.pos + o) ~=0)
228  end
229  return false
230end
231
232function mt:Testhashs32Fnv1()
233  local o = self.view:Offset(36)
234  if o ~= 0 then
235    return self.view:Get(flatbuffers.N.Int32, self.view.pos + o)
236  end
237  return 0
238end
239
240function mt:Testhashu32Fnv1()
241  local o = self.view:Offset(38)
242  if o ~= 0 then
243    return self.view:Get(flatbuffers.N.Uint32, self.view.pos + o)
244  end
245  return 0
246end
247
248function mt:Testhashs64Fnv1()
249  local o = self.view:Offset(40)
250  if o ~= 0 then
251    return self.view:Get(flatbuffers.N.Int64, self.view.pos + o)
252  end
253  return 0
254end
255
256function mt:Testhashu64Fnv1()
257  local o = self.view:Offset(42)
258  if o ~= 0 then
259    return self.view:Get(flatbuffers.N.Uint64, self.view.pos + o)
260  end
261  return 0
262end
263
264function mt:Testhashs32Fnv1a()
265  local o = self.view:Offset(44)
266  if o ~= 0 then
267    return self.view:Get(flatbuffers.N.Int32, self.view.pos + o)
268  end
269  return 0
270end
271
272function mt:Testhashu32Fnv1a()
273  local o = self.view:Offset(46)
274  if o ~= 0 then
275    return self.view:Get(flatbuffers.N.Uint32, self.view.pos + o)
276  end
277  return 0
278end
279
280function mt:Testhashs64Fnv1a()
281  local o = self.view:Offset(48)
282  if o ~= 0 then
283    return self.view:Get(flatbuffers.N.Int64, self.view.pos + o)
284  end
285  return 0
286end
287
288function mt:Testhashu64Fnv1a()
289  local o = self.view:Offset(50)
290  if o ~= 0 then
291    return self.view:Get(flatbuffers.N.Uint64, self.view.pos + o)
292  end
293  return 0
294end
295
296function mt:Testarrayofbools(j)
297  local o = self.view:Offset(52)
298  if o ~= 0 then
299    local a = self.view:Vector(o)
300    return self.view:Get(flatbuffers.N.Bool, a + ((j-1) * 1))
301  end
302  return 0
303end
304
305function mt:TestarrayofboolsAsString(start, stop)
306  return self.view:VectorAsString(52, start, stop)
307end
308
309function mt:TestarrayofboolsLength()
310  local o = self.view:Offset(52)
311  if o ~= 0 then
312    return self.view:VectorLen(o)
313  end
314  return 0
315end
316
317function mt:Testf()
318  local o = self.view:Offset(54)
319  if o ~= 0 then
320    return self.view:Get(flatbuffers.N.Float32, self.view.pos + o)
321  end
322  return 3.14159
323end
324
325function mt:Testf2()
326  local o = self.view:Offset(56)
327  if o ~= 0 then
328    return self.view:Get(flatbuffers.N.Float32, self.view.pos + o)
329  end
330  return 3.0
331end
332
333function mt:Testf3()
334  local o = self.view:Offset(58)
335  if o ~= 0 then
336    return self.view:Get(flatbuffers.N.Float32, self.view.pos + o)
337  end
338  return 0.0
339end
340
341function mt:Testarrayofstring2(j)
342  local o = self.view:Offset(60)
343  if o ~= 0 then
344    local a = self.view:Vector(o)
345    return self.view:String(a + ((j-1) * 4))
346  end
347  return ''
348end
349
350function mt:Testarrayofstring2Length()
351  local o = self.view:Offset(60)
352  if o ~= 0 then
353    return self.view:VectorLen(o)
354  end
355  return 0
356end
357
358function mt:Testarrayofsortedstruct(j)
359  local o = self.view:Offset(62)
360  if o ~= 0 then
361    local x = self.view:Vector(o)
362    x = x + ((j-1) * 4)
363    local obj = __MyGame_Example_Ability.New()
364    obj:Init(self.view.bytes, x)
365    return obj
366  end
367end
368
369function mt:TestarrayofsortedstructLength()
370  local o = self.view:Offset(62)
371  if o ~= 0 then
372    return self.view:VectorLen(o)
373  end
374  return 0
375end
376
377function mt:Flex(j)
378  local o = self.view:Offset(64)
379  if o ~= 0 then
380    local a = self.view:Vector(o)
381    return self.view:Get(flatbuffers.N.Uint8, a + ((j-1) * 1))
382  end
383  return 0
384end
385
386function mt:FlexAsString(start, stop)
387  return self.view:VectorAsString(64, start, stop)
388end
389
390function mt:FlexLength()
391  local o = self.view:Offset(64)
392  if o ~= 0 then
393    return self.view:VectorLen(o)
394  end
395  return 0
396end
397
398function mt:Test5(j)
399  local o = self.view:Offset(66)
400  if o ~= 0 then
401    local x = self.view:Vector(o)
402    x = x + ((j-1) * 4)
403    local obj = __MyGame_Example_Test.New()
404    obj:Init(self.view.bytes, x)
405    return obj
406  end
407end
408
409function mt:Test5Length()
410  local o = self.view:Offset(66)
411  if o ~= 0 then
412    return self.view:VectorLen(o)
413  end
414  return 0
415end
416
417function mt:VectorOfLongs(j)
418  local o = self.view:Offset(68)
419  if o ~= 0 then
420    local a = self.view:Vector(o)
421    return self.view:Get(flatbuffers.N.Int64, a + ((j-1) * 8))
422  end
423  return 0
424end
425
426function mt:VectorOfLongsLength()
427  local o = self.view:Offset(68)
428  if o ~= 0 then
429    return self.view:VectorLen(o)
430  end
431  return 0
432end
433
434function mt:VectorOfDoubles(j)
435  local o = self.view:Offset(70)
436  if o ~= 0 then
437    local a = self.view:Vector(o)
438    return self.view:Get(flatbuffers.N.Float64, a + ((j-1) * 8))
439  end
440  return 0
441end
442
443function mt:VectorOfDoublesLength()
444  local o = self.view:Offset(70)
445  if o ~= 0 then
446    return self.view:VectorLen(o)
447  end
448  return 0
449end
450
451function mt:ParentNamespaceTest()
452  local o = self.view:Offset(72)
453  if o ~= 0 then
454    local x = self.view:Indirect(self.view.pos + o)
455    local obj = __MyGame_InParentNamespace.New()
456    obj:Init(self.view.bytes, x)
457    return obj
458  end
459end
460
461function mt:VectorOfReferrables(j)
462  local o = self.view:Offset(74)
463  if o ~= 0 then
464    local x = self.view:Vector(o)
465    x = x + ((j-1) * 4)
466    x = self.view:Indirect(x)
467    local obj = __MyGame_Example_Referrable.New()
468    obj:Init(self.view.bytes, x)
469    return obj
470  end
471end
472
473function mt:VectorOfReferrablesLength()
474  local o = self.view:Offset(74)
475  if o ~= 0 then
476    return self.view:VectorLen(o)
477  end
478  return 0
479end
480
481function mt:SingleWeakReference()
482  local o = self.view:Offset(76)
483  if o ~= 0 then
484    return self.view:Get(flatbuffers.N.Uint64, self.view.pos + o)
485  end
486  return 0
487end
488
489function mt:VectorOfWeakReferences(j)
490  local o = self.view:Offset(78)
491  if o ~= 0 then
492    local a = self.view:Vector(o)
493    return self.view:Get(flatbuffers.N.Uint64, a + ((j-1) * 8))
494  end
495  return 0
496end
497
498function mt:VectorOfWeakReferencesLength()
499  local o = self.view:Offset(78)
500  if o ~= 0 then
501    return self.view:VectorLen(o)
502  end
503  return 0
504end
505
506function mt:VectorOfStrongReferrables(j)
507  local o = self.view:Offset(80)
508  if o ~= 0 then
509    local x = self.view:Vector(o)
510    x = x + ((j-1) * 4)
511    x = self.view:Indirect(x)
512    local obj = __MyGame_Example_Referrable.New()
513    obj:Init(self.view.bytes, x)
514    return obj
515  end
516end
517
518function mt:VectorOfStrongReferrablesLength()
519  local o = self.view:Offset(80)
520  if o ~= 0 then
521    return self.view:VectorLen(o)
522  end
523  return 0
524end
525
526function mt:CoOwningReference()
527  local o = self.view:Offset(82)
528  if o ~= 0 then
529    return self.view:Get(flatbuffers.N.Uint64, self.view.pos + o)
530  end
531  return 0
532end
533
534function mt:VectorOfCoOwningReferences(j)
535  local o = self.view:Offset(84)
536  if o ~= 0 then
537    local a = self.view:Vector(o)
538    return self.view:Get(flatbuffers.N.Uint64, a + ((j-1) * 8))
539  end
540  return 0
541end
542
543function mt:VectorOfCoOwningReferencesLength()
544  local o = self.view:Offset(84)
545  if o ~= 0 then
546    return self.view:VectorLen(o)
547  end
548  return 0
549end
550
551function mt:NonOwningReference()
552  local o = self.view:Offset(86)
553  if o ~= 0 then
554    return self.view:Get(flatbuffers.N.Uint64, self.view.pos + o)
555  end
556  return 0
557end
558
559function mt:VectorOfNonOwningReferences(j)
560  local o = self.view:Offset(88)
561  if o ~= 0 then
562    local a = self.view:Vector(o)
563    return self.view:Get(flatbuffers.N.Uint64, a + ((j-1) * 8))
564  end
565  return 0
566end
567
568function mt:VectorOfNonOwningReferencesLength()
569  local o = self.view:Offset(88)
570  if o ~= 0 then
571    return self.view:VectorLen(o)
572  end
573  return 0
574end
575
576function mt:AnyUniqueType()
577  local o = self.view:Offset(90)
578  if o ~= 0 then
579    return self.view:Get(flatbuffers.N.Uint8, self.view.pos + o)
580  end
581  return 0
582end
583
584function mt:AnyUnique()
585  local o = self.view:Offset(92)
586  if o ~= 0 then
587   local obj = flatbuffers.view.New(flatbuffers.binaryArray.New(0), 0)
588    self.view:Union(obj, o)
589    return obj
590  end
591end
592
593function mt:AnyAmbiguousType()
594  local o = self.view:Offset(94)
595  if o ~= 0 then
596    return self.view:Get(flatbuffers.N.Uint8, self.view.pos + o)
597  end
598  return 0
599end
600
601function mt:AnyAmbiguous()
602  local o = self.view:Offset(96)
603  if o ~= 0 then
604   local obj = flatbuffers.view.New(flatbuffers.binaryArray.New(0), 0)
605    self.view:Union(obj, o)
606    return obj
607  end
608end
609
610function mt:VectorOfEnums(j)
611  local o = self.view:Offset(98)
612  if o ~= 0 then
613    local a = self.view:Vector(o)
614    return self.view:Get(flatbuffers.N.Uint8, a + ((j-1) * 1))
615  end
616  return 0
617end
618
619function mt:VectorOfEnumsAsString(start, stop)
620  return self.view:VectorAsString(98, start, stop)
621end
622
623function mt:VectorOfEnumsLength()
624  local o = self.view:Offset(98)
625  if o ~= 0 then
626    return self.view:VectorLen(o)
627  end
628  return 0
629end
630
631function mt:SignedEnum()
632  local o = self.view:Offset(100)
633  if o ~= 0 then
634    return self.view:Get(flatbuffers.N.Int8, self.view.pos + o)
635  end
636  return -1
637end
638
639function mt:Testrequirednestedflatbuffer(j)
640  local o = self.view:Offset(102)
641  if o ~= 0 then
642    local a = self.view:Vector(o)
643    return self.view:Get(flatbuffers.N.Uint8, a + ((j-1) * 1))
644  end
645  return 0
646end
647
648function mt:TestrequirednestedflatbufferAsString(start, stop)
649  return self.view:VectorAsString(102, start, stop)
650end
651
652function mt:TestrequirednestedflatbufferLength()
653  local o = self.view:Offset(102)
654  if o ~= 0 then
655    return self.view:VectorLen(o)
656  end
657  return 0
658end
659
660function mt:ScalarKeySortedTables(j)
661  local o = self.view:Offset(104)
662  if o ~= 0 then
663    local x = self.view:Vector(o)
664    x = x + ((j-1) * 4)
665    x = self.view:Indirect(x)
666    local obj = __MyGame_Example_Stat.New()
667    obj:Init(self.view.bytes, x)
668    return obj
669  end
670end
671
672function mt:ScalarKeySortedTablesLength()
673  local o = self.view:Offset(104)
674  if o ~= 0 then
675    return self.view:VectorLen(o)
676  end
677  return 0
678end
679
680function mt:NativeInline()
681  local o = self.view:Offset(106)
682  if o ~= 0 then
683    local x = self.view.pos + o
684    local obj = __MyGame_Example_Test.New()
685    obj:Init(self.view.bytes, x)
686    return obj
687  end
688end
689
690function mt:LongEnumNonEnumDefault()
691  local o = self.view:Offset(108)
692  if o ~= 0 then
693    return self.view:Get(flatbuffers.N.Uint64, self.view.pos + o)
694  end
695  return 0
696end
697
698function mt:LongEnumNormalDefault()
699  local o = self.view:Offset(110)
700  if o ~= 0 then
701    return self.view:Get(flatbuffers.N.Uint64, self.view.pos + o)
702  end
703  return 2
704end
705
706function Monster.Start(builder)
707  builder:StartObject(54)
708end
709
710function Monster.AddPos(builder, pos)
711  builder:PrependStructSlot(0, pos, 0)
712end
713
714function Monster.AddMana(builder, mana)
715  builder:PrependInt16Slot(1, mana, 150)
716end
717
718function Monster.AddHp(builder, hp)
719  builder:PrependInt16Slot(2, hp, 100)
720end
721
722function Monster.AddName(builder, name)
723  builder:PrependUOffsetTRelativeSlot(3, name, 0)
724end
725
726function Monster.AddInventory(builder, inventory)
727  builder:PrependUOffsetTRelativeSlot(5, inventory, 0)
728end
729
730function Monster.StartInventoryVector(builder, numElems)
731  return builder:StartVector(1, numElems, 1)
732end
733
734function Monster.AddColor(builder, color)
735  builder:PrependUint8Slot(6, color, 8)
736end
737
738function Monster.AddTestType(builder, testType)
739  builder:PrependUint8Slot(7, testType, 0)
740end
741
742function Monster.AddTest(builder, test)
743  builder:PrependUOffsetTRelativeSlot(8, test, 0)
744end
745
746function Monster.AddTest4(builder, test4)
747  builder:PrependUOffsetTRelativeSlot(9, test4, 0)
748end
749
750function Monster.StartTest4Vector(builder, numElems)
751  return builder:StartVector(4, numElems, 2)
752end
753
754function Monster.AddTestarrayofstring(builder, testarrayofstring)
755  builder:PrependUOffsetTRelativeSlot(10, testarrayofstring, 0)
756end
757
758function Monster.StartTestarrayofstringVector(builder, numElems)
759  return builder:StartVector(4, numElems, 4)
760end
761
762function Monster.AddTestarrayoftables(builder, testarrayoftables)
763  builder:PrependUOffsetTRelativeSlot(11, testarrayoftables, 0)
764end
765
766function Monster.StartTestarrayoftablesVector(builder, numElems)
767  return builder:StartVector(4, numElems, 4)
768end
769
770function Monster.AddEnemy(builder, enemy)
771  builder:PrependStructSlot(12, enemy, 0)
772end
773
774function Monster.AddTestnestedflatbuffer(builder, testnestedflatbuffer)
775  builder:PrependUOffsetTRelativeSlot(13, testnestedflatbuffer, 0)
776end
777
778function Monster.StartTestnestedflatbufferVector(builder, numElems)
779  return builder:StartVector(1, numElems, 1)
780end
781
782function Monster.AddTestempty(builder, testempty)
783  builder:PrependStructSlot(14, testempty, 0)
784end
785
786function Monster.AddTestbool(builder, testbool)
787  builder:PrependBoolSlot(15, testbool, false)
788end
789
790function Monster.AddTesthashs32Fnv1(builder, testhashs32Fnv1)
791  builder:PrependInt32Slot(16, testhashs32Fnv1, 0)
792end
793
794function Monster.AddTesthashu32Fnv1(builder, testhashu32Fnv1)
795  builder:PrependUint32Slot(17, testhashu32Fnv1, 0)
796end
797
798function Monster.AddTesthashs64Fnv1(builder, testhashs64Fnv1)
799  builder:PrependInt64Slot(18, testhashs64Fnv1, 0)
800end
801
802function Monster.AddTesthashu64Fnv1(builder, testhashu64Fnv1)
803  builder:PrependUint64Slot(19, testhashu64Fnv1, 0)
804end
805
806function Monster.AddTesthashs32Fnv1a(builder, testhashs32Fnv1a)
807  builder:PrependInt32Slot(20, testhashs32Fnv1a, 0)
808end
809
810function Monster.AddTesthashu32Fnv1a(builder, testhashu32Fnv1a)
811  builder:PrependUint32Slot(21, testhashu32Fnv1a, 0)
812end
813
814function Monster.AddTesthashs64Fnv1a(builder, testhashs64Fnv1a)
815  builder:PrependInt64Slot(22, testhashs64Fnv1a, 0)
816end
817
818function Monster.AddTesthashu64Fnv1a(builder, testhashu64Fnv1a)
819  builder:PrependUint64Slot(23, testhashu64Fnv1a, 0)
820end
821
822function Monster.AddTestarrayofbools(builder, testarrayofbools)
823  builder:PrependUOffsetTRelativeSlot(24, testarrayofbools, 0)
824end
825
826function Monster.StartTestarrayofboolsVector(builder, numElems)
827  return builder:StartVector(1, numElems, 1)
828end
829
830function Monster.AddTestf(builder, testf)
831  builder:PrependFloat32Slot(25, testf, 3.14159)
832end
833
834function Monster.AddTestf2(builder, testf2)
835  builder:PrependFloat32Slot(26, testf2, 3.0)
836end
837
838function Monster.AddTestf3(builder, testf3)
839  builder:PrependFloat32Slot(27, testf3, 0.0)
840end
841
842function Monster.AddTestarrayofstring2(builder, testarrayofstring2)
843  builder:PrependUOffsetTRelativeSlot(28, testarrayofstring2, 0)
844end
845
846function Monster.StartTestarrayofstring2Vector(builder, numElems)
847  return builder:StartVector(4, numElems, 4)
848end
849
850function Monster.AddTestarrayofsortedstruct(builder, testarrayofsortedstruct)
851  builder:PrependUOffsetTRelativeSlot(29, testarrayofsortedstruct, 0)
852end
853
854function Monster.StartTestarrayofsortedstructVector(builder, numElems)
855  return builder:StartVector(4, numElems, 4)
856end
857
858function Monster.AddFlex(builder, flex)
859  builder:PrependUOffsetTRelativeSlot(30, flex, 0)
860end
861
862function Monster.StartFlexVector(builder, numElems)
863  return builder:StartVector(1, numElems, 1)
864end
865
866function Monster.AddTest5(builder, test5)
867  builder:PrependUOffsetTRelativeSlot(31, test5, 0)
868end
869
870function Monster.StartTest5Vector(builder, numElems)
871  return builder:StartVector(4, numElems, 2)
872end
873
874function Monster.AddVectorOfLongs(builder, vectorOfLongs)
875  builder:PrependUOffsetTRelativeSlot(32, vectorOfLongs, 0)
876end
877
878function Monster.StartVectorOfLongsVector(builder, numElems)
879  return builder:StartVector(8, numElems, 8)
880end
881
882function Monster.AddVectorOfDoubles(builder, vectorOfDoubles)
883  builder:PrependUOffsetTRelativeSlot(33, vectorOfDoubles, 0)
884end
885
886function Monster.StartVectorOfDoublesVector(builder, numElems)
887  return builder:StartVector(8, numElems, 8)
888end
889
890function Monster.AddParentNamespaceTest(builder, parentNamespaceTest)
891  builder:PrependStructSlot(34, parentNamespaceTest, 0)
892end
893
894function Monster.AddVectorOfReferrables(builder, vectorOfReferrables)
895  builder:PrependUOffsetTRelativeSlot(35, vectorOfReferrables, 0)
896end
897
898function Monster.StartVectorOfReferrablesVector(builder, numElems)
899  return builder:StartVector(4, numElems, 4)
900end
901
902function Monster.AddSingleWeakReference(builder, singleWeakReference)
903  builder:PrependUint64Slot(36, singleWeakReference, 0)
904end
905
906function Monster.AddVectorOfWeakReferences(builder, vectorOfWeakReferences)
907  builder:PrependUOffsetTRelativeSlot(37, vectorOfWeakReferences, 0)
908end
909
910function Monster.StartVectorOfWeakReferencesVector(builder, numElems)
911  return builder:StartVector(8, numElems, 8)
912end
913
914function Monster.AddVectorOfStrongReferrables(builder, vectorOfStrongReferrables)
915  builder:PrependUOffsetTRelativeSlot(38, vectorOfStrongReferrables, 0)
916end
917
918function Monster.StartVectorOfStrongReferrablesVector(builder, numElems)
919  return builder:StartVector(4, numElems, 4)
920end
921
922function Monster.AddCoOwningReference(builder, coOwningReference)
923  builder:PrependUint64Slot(39, coOwningReference, 0)
924end
925
926function Monster.AddVectorOfCoOwningReferences(builder, vectorOfCoOwningReferences)
927  builder:PrependUOffsetTRelativeSlot(40, vectorOfCoOwningReferences, 0)
928end
929
930function Monster.StartVectorOfCoOwningReferencesVector(builder, numElems)
931  return builder:StartVector(8, numElems, 8)
932end
933
934function Monster.AddNonOwningReference(builder, nonOwningReference)
935  builder:PrependUint64Slot(41, nonOwningReference, 0)
936end
937
938function Monster.AddVectorOfNonOwningReferences(builder, vectorOfNonOwningReferences)
939  builder:PrependUOffsetTRelativeSlot(42, vectorOfNonOwningReferences, 0)
940end
941
942function Monster.StartVectorOfNonOwningReferencesVector(builder, numElems)
943  return builder:StartVector(8, numElems, 8)
944end
945
946function Monster.AddAnyUniqueType(builder, anyUniqueType)
947  builder:PrependUint8Slot(43, anyUniqueType, 0)
948end
949
950function Monster.AddAnyUnique(builder, anyUnique)
951  builder:PrependUOffsetTRelativeSlot(44, anyUnique, 0)
952end
953
954function Monster.AddAnyAmbiguousType(builder, anyAmbiguousType)
955  builder:PrependUint8Slot(45, anyAmbiguousType, 0)
956end
957
958function Monster.AddAnyAmbiguous(builder, anyAmbiguous)
959  builder:PrependUOffsetTRelativeSlot(46, anyAmbiguous, 0)
960end
961
962function Monster.AddVectorOfEnums(builder, vectorOfEnums)
963  builder:PrependUOffsetTRelativeSlot(47, vectorOfEnums, 0)
964end
965
966function Monster.StartVectorOfEnumsVector(builder, numElems)
967  return builder:StartVector(1, numElems, 1)
968end
969
970function Monster.AddSignedEnum(builder, signedEnum)
971  builder:PrependInt8Slot(48, signedEnum, -1)
972end
973
974function Monster.AddTestrequirednestedflatbuffer(builder, testrequirednestedflatbuffer)
975  builder:PrependUOffsetTRelativeSlot(49, testrequirednestedflatbuffer, 0)
976end
977
978function Monster.StartTestrequirednestedflatbufferVector(builder, numElems)
979  return builder:StartVector(1, numElems, 1)
980end
981
982function Monster.AddScalarKeySortedTables(builder, scalarKeySortedTables)
983  builder:PrependUOffsetTRelativeSlot(50, scalarKeySortedTables, 0)
984end
985
986function Monster.StartScalarKeySortedTablesVector(builder, numElems)
987  return builder:StartVector(4, numElems, 4)
988end
989
990function Monster.AddNativeInline(builder, nativeInline)
991  builder:PrependStructSlot(51, nativeInline, 0)
992end
993
994function Monster.AddLongEnumNonEnumDefault(builder, longEnumNonEnumDefault)
995  builder:PrependUint64Slot(52, longEnumNonEnumDefault, 0)
996end
997
998function Monster.AddLongEnumNormalDefault(builder, longEnumNormalDefault)
999  builder:PrependUint64Slot(53, longEnumNormalDefault, 2)
1000end
1001
1002function Monster.End(builder)
1003  return builder:EndObject()
1004end
1005
1006return Monster