summaryrefslogtreecommitdiff
path: root/tests/monster_test_generated.lobster
blob: 74c5967a9cbd3fa046f95daca263677586860328 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
// automatically generated by the FlatBuffers compiler, do not modify
import flatbuffers

namespace MyGame_Example

/// Composite components of Monster color.
enum Color:
    Color_Red = 1
    /// \brief color Green
    /// Green is bit_flag with value (1u << 1)
    Color_Green = 2
    /// \brief color Blue (1u << 3)
    Color_Blue = 8

enum Race:
    Race_None = -1
    Race_Human = 0
    Race_Dwarf = 1
    Race_Elf = 2

enum Any:
    Any_NONE = 0
    Any_Monster = 1
    Any_TestSimpleTableWithEnum = 2
    Any_MyGame_Example2_Monster = 3

enum AnyUniqueAliases:
    AnyUniqueAliases_NONE = 0
    AnyUniqueAliases_M = 1
    AnyUniqueAliases_TS = 2
    AnyUniqueAliases_M2 = 3

enum AnyAmbiguousAliases:
    AnyAmbiguousAliases_NONE = 0
    AnyAmbiguousAliases_M1 = 1
    AnyAmbiguousAliases_M2 = 2
    AnyAmbiguousAliases_M3 = 3

namespace MyGame

class InParentNamespace

namespace MyGame_Example2

class Monster

namespace MyGame_Example

class Test

class TestSimpleTableWithEnum

class Vec3

class Ability

class Stat

class Referrable

class Monster

class TypeAliases

namespace MyGame

class InParentNamespace : flatbuffers_handle

def GetRootAsInParentNamespace(buf:string): return InParentNamespace { buf, buf.flatbuffers_indirect(0) }

struct InParentNamespaceBuilder:
    b_:flatbuffers_builder
    def start():
        b_.StartObject(0)
        return this
    def end():
        return b_.EndObject()

namespace MyGame_Example2

class Monster : flatbuffers_handle

def GetRootAsMonster(buf:string): return Monster { buf, buf.flatbuffers_indirect(0) }

struct MonsterBuilder:
    b_:flatbuffers_builder
    def start():
        b_.StartObject(0)
        return this
    def end():
        return b_.EndObject()

namespace MyGame_Example

class Test : flatbuffers_handle
    def a():
        return buf_.read_int16_le(pos_ + 0)
    def b():
        return buf_.read_int8_le(pos_ + 2)

def CreateTest(b_:flatbuffers_builder, a:int, b:int):
    b_.Prep(2, 4)
    b_.Pad(1)
    b_.PrependInt8(b)
    b_.PrependInt16(a)
    return b_.Offset()

class TestSimpleTableWithEnum : flatbuffers_handle
    def color():
        return Color(buf_.flatbuffers_field_int8(pos_, 4, 2))

def GetRootAsTestSimpleTableWithEnum(buf:string): return TestSimpleTableWithEnum { buf, buf.flatbuffers_indirect(0) }

struct TestSimpleTableWithEnumBuilder:
    b_:flatbuffers_builder
    def start():
        b_.StartObject(1)
        return this
    def add_color(color:Color):
        b_.PrependUint8Slot(0, color, 2)
        return this
    def end():
        return b_.EndObject()

class Vec3 : flatbuffers_handle
    def x():
        return buf_.read_float32_le(pos_ + 0)
    def y():
        return buf_.read_float32_le(pos_ + 4)
    def z():
        return buf_.read_float32_le(pos_ + 8)
    def test1():
        return buf_.read_float64_le(pos_ + 16)
    def test2():
        return Color(buf_.read_int8_le(pos_ + 24))
    def test3():
        return MyGame_Example_Test{ buf_, pos_ + 26 }

def CreateVec3(b_:flatbuffers_builder, x:float, y:float, z:float, test1:float, test2:Color, test3_a:int, test3_b:int):
    b_.Prep(8, 32)
    b_.Pad(2)
    b_.Prep(2, 4)
    b_.Pad(1)
    b_.PrependInt8(test3_b)
    b_.PrependInt16(test3_a)
    b_.Pad(1)
    b_.PrependUint8(test2)
    b_.PrependFloat64(test1)
    b_.Pad(4)
    b_.PrependFloat32(z)
    b_.PrependFloat32(y)
    b_.PrependFloat32(x)
    return b_.Offset()

class Ability : flatbuffers_handle
    def id():
        return buf_.read_int32_le(pos_ + 0)
    def distance():
        return buf_.read_int32_le(pos_ + 4)

def CreateAbility(b_:flatbuffers_builder, id:int, distance:int):
    b_.Prep(4, 8)
    b_.PrependUint32(distance)
    b_.PrependUint32(id)
    return b_.Offset()

class Stat : flatbuffers_handle
    def id():
        return buf_.flatbuffers_field_string(pos_, 4)
    def val():
        return buf_.flatbuffers_field_int64(pos_, 6, 0)
    def count():
        return buf_.flatbuffers_field_int16(pos_, 8, 0)

def GetRootAsStat(buf:string): return Stat { buf, buf.flatbuffers_indirect(0) }

struct StatBuilder:
    b_:flatbuffers_builder
    def start():
        b_.StartObject(3)
        return this
    def add_id(id:flatbuffers_offset):
        b_.PrependUOffsetTRelativeSlot(0, id)
        return this
    def add_val(val:int):
        b_.PrependInt64Slot(1, val, 0)
        return this
    def add_count(count:int):
        b_.PrependUint16Slot(2, count, 0)
        return this
    def end():
        return b_.EndObject()

class Referrable : flatbuffers_handle
    def id():
        return buf_.flatbuffers_field_int64(pos_, 4, 0)

def GetRootAsReferrable(buf:string): return Referrable { buf, buf.flatbuffers_indirect(0) }

struct ReferrableBuilder:
    b_:flatbuffers_builder
    def start():
        b_.StartObject(1)
        return this
    def add_id(id:int):
        b_.PrependUint64Slot(0, id, 0)
        return this
    def end():
        return b_.EndObject()

/// an example documentation comment: monster object
class Monster : flatbuffers_handle
    def pos():
        let o = buf_.flatbuffers_field_struct(pos_, 4)
        return if o: MyGame_Example_Vec3 { buf_, o } else: nil
    def mana():
        return buf_.flatbuffers_field_int16(pos_, 6, 150)
    def hp():
        return buf_.flatbuffers_field_int16(pos_, 8, 100)
    def name():
        return buf_.flatbuffers_field_string(pos_, 10)
    def inventory(i:int):
        return buf_.read_int8_le(buf_.flatbuffers_field_vector(pos_, 14) + i * 1)
    def inventory_length():
        return buf_.flatbuffers_field_vector_len(pos_, 14)
    def color():
        return Color(buf_.flatbuffers_field_int8(pos_, 16, 8))
    def test_type():
        return Any(buf_.flatbuffers_field_int8(pos_, 18, 0))
    def test_as_Monster():
        return MyGame_Example_Monster { buf_, buf_.flatbuffers_field_table(pos_, 20) }
    def test_as_TestSimpleTableWithEnum():
        return MyGame_Example_TestSimpleTableWithEnum { buf_, buf_.flatbuffers_field_table(pos_, 20) }
    def test_as_MyGame_Example2_Monster():
        return MyGame_Example2_Monster { buf_, buf_.flatbuffers_field_table(pos_, 20) }
    def test4(i:int):
        return MyGame_Example_Test { buf_, buf_.flatbuffers_field_vector(pos_, 22) + i * 4 }
    def test4_length():
        return buf_.flatbuffers_field_vector_len(pos_, 22)
    def testarrayofstring(i:int):
        return buf_.flatbuffers_string(buf_.flatbuffers_field_vector(pos_, 24) + i * 4)
    def testarrayofstring_length():
        return buf_.flatbuffers_field_vector_len(pos_, 24)
    /// an example documentation comment: this will end up in the generated code
    /// multiline too
    def testarrayoftables(i:int):
        return MyGame_Example_Monster { buf_, buf_.flatbuffers_indirect(buf_.flatbuffers_field_vector(pos_, 26) + i * 4) }
    def testarrayoftables_length():
        return buf_.flatbuffers_field_vector_len(pos_, 26)
    def enemy():
        let o = buf_.flatbuffers_field_table(pos_, 28)
        return if o: MyGame_Example_Monster { buf_, o } else: nil
    def testnestedflatbuffer(i:int):
        return buf_.read_int8_le(buf_.flatbuffers_field_vector(pos_, 30) + i * 1)
    def testnestedflatbuffer_length():
        return buf_.flatbuffers_field_vector_len(pos_, 30)
    def testempty():
        let o = buf_.flatbuffers_field_table(pos_, 32)
        return if o: MyGame_Example_Stat { buf_, o } else: nil
    def testbool():
        return buf_.flatbuffers_field_int8(pos_, 34, 0)
    def testhashs32_fnv1():
        return buf_.flatbuffers_field_int32(pos_, 36, 0)
    def testhashu32_fnv1():
        return buf_.flatbuffers_field_int32(pos_, 38, 0)
    def testhashs64_fnv1():
        return buf_.flatbuffers_field_int64(pos_, 40, 0)
    def testhashu64_fnv1():
        return buf_.flatbuffers_field_int64(pos_, 42, 0)
    def testhashs32_fnv1a():
        return buf_.flatbuffers_field_int32(pos_, 44, 0)
    def testhashu32_fnv1a():
        return buf_.flatbuffers_field_int32(pos_, 46, 0)
    def testhashs64_fnv1a():
        return buf_.flatbuffers_field_int64(pos_, 48, 0)
    def testhashu64_fnv1a():
        return buf_.flatbuffers_field_int64(pos_, 50, 0)
    def testarrayofbools(i:int):
        return buf_.read_int8_le(buf_.flatbuffers_field_vector(pos_, 52) + i * 1)
    def testarrayofbools_length():
        return buf_.flatbuffers_field_vector_len(pos_, 52)
    def testf():
        return buf_.flatbuffers_field_float32(pos_, 54, 3.14159)
    def testf2():
        return buf_.flatbuffers_field_float32(pos_, 56, 3.0)
    def testf3():
        return buf_.flatbuffers_field_float32(pos_, 58, 0.0)
    def testarrayofstring2(i:int):
        return buf_.flatbuffers_string(buf_.flatbuffers_field_vector(pos_, 60) + i * 4)
    def testarrayofstring2_length():
        return buf_.flatbuffers_field_vector_len(pos_, 60)
    def testarrayofsortedstruct(i:int):
        return MyGame_Example_Ability { buf_, buf_.flatbuffers_field_vector(pos_, 62) + i * 8 }
    def testarrayofsortedstruct_length():
        return buf_.flatbuffers_field_vector_len(pos_, 62)
    def flex(i:int):
        return buf_.read_int8_le(buf_.flatbuffers_field_vector(pos_, 64) + i * 1)
    def flex_length():
        return buf_.flatbuffers_field_vector_len(pos_, 64)
    def test5(i:int):
        return MyGame_Example_Test { buf_, buf_.flatbuffers_field_vector(pos_, 66) + i * 4 }
    def test5_length():
        return buf_.flatbuffers_field_vector_len(pos_, 66)
    def vector_of_longs(i:int):
        return buf_.read_int64_le(buf_.flatbuffers_field_vector(pos_, 68) + i * 8)
    def vector_of_longs_length():
        return buf_.flatbuffers_field_vector_len(pos_, 68)
    def vector_of_doubles(i:int):
        return buf_.read_float64_le(buf_.flatbuffers_field_vector(pos_, 70) + i * 8)
    def vector_of_doubles_length():
        return buf_.flatbuffers_field_vector_len(pos_, 70)
    def parent_namespace_test():
        let o = buf_.flatbuffers_field_table(pos_, 72)
        return if o: MyGame_InParentNamespace { buf_, o } else: nil
    def vector_of_referrables(i:int):
        return MyGame_Example_Referrable { buf_, buf_.flatbuffers_indirect(buf_.flatbuffers_field_vector(pos_, 74) + i * 4) }
    def vector_of_referrables_length():
        return buf_.flatbuffers_field_vector_len(pos_, 74)
    def single_weak_reference():
        return buf_.flatbuffers_field_int64(pos_, 76, 0)
    def vector_of_weak_references(i:int):
        return buf_.read_int64_le(buf_.flatbuffers_field_vector(pos_, 78) + i * 8)
    def vector_of_weak_references_length():
        return buf_.flatbuffers_field_vector_len(pos_, 78)
    def vector_of_strong_referrables(i:int):
        return MyGame_Example_Referrable { buf_, buf_.flatbuffers_indirect(buf_.flatbuffers_field_vector(pos_, 80) + i * 4) }
    def vector_of_strong_referrables_length():
        return buf_.flatbuffers_field_vector_len(pos_, 80)
    def co_owning_reference():
        return buf_.flatbuffers_field_int64(pos_, 82, 0)
    def vector_of_co_owning_references(i:int):
        return buf_.read_int64_le(buf_.flatbuffers_field_vector(pos_, 84) + i * 8)
    def vector_of_co_owning_references_length():
        return buf_.flatbuffers_field_vector_len(pos_, 84)
    def non_owning_reference():
        return buf_.flatbuffers_field_int64(pos_, 86, 0)
    def vector_of_non_owning_references(i:int):
        return buf_.read_int64_le(buf_.flatbuffers_field_vector(pos_, 88) + i * 8)
    def vector_of_non_owning_references_length():
        return buf_.flatbuffers_field_vector_len(pos_, 88)
    def any_unique_type():
        return AnyUniqueAliases(buf_.flatbuffers_field_int8(pos_, 90, 0))
    def any_unique_as_M():
        return MyGame_Example_Monster { buf_, buf_.flatbuffers_field_table(pos_, 92) }
    def any_unique_as_TS():
        return MyGame_Example_TestSimpleTableWithEnum { buf_, buf_.flatbuffers_field_table(pos_, 92) }
    def any_unique_as_M2():
        return MyGame_Example2_Monster { buf_, buf_.flatbuffers_field_table(pos_, 92) }
    def any_ambiguous_type():
        return AnyAmbiguousAliases(buf_.flatbuffers_field_int8(pos_, 94, 0))
    def any_ambiguous_as_M1():
        return MyGame_Example_Monster { buf_, buf_.flatbuffers_field_table(pos_, 96) }
    def any_ambiguous_as_M2():
        return MyGame_Example_Monster { buf_, buf_.flatbuffers_field_table(pos_, 96) }
    def any_ambiguous_as_M3():
        return MyGame_Example_Monster { buf_, buf_.flatbuffers_field_table(pos_, 96) }
    def vector_of_enums(i:int):
        return buf_.read_int8_le(buf_.flatbuffers_field_vector(pos_, 98) + i * 1)
    def vector_of_enums_length():
        return buf_.flatbuffers_field_vector_len(pos_, 98)
    def signed_enum():
        return Race(buf_.flatbuffers_field_int8(pos_, 100, -1))

def GetRootAsMonster(buf:string): return Monster { buf, buf.flatbuffers_indirect(0) }

struct MonsterBuilder:
    b_:flatbuffers_builder
    def start():
        b_.StartObject(49)
        return this
    def add_pos(pos:flatbuffers_offset):
        b_.PrependStructSlot(0, pos)
        return this
    def add_mana(mana:int):
        b_.PrependInt16Slot(1, mana, 150)
        return this
    def add_hp(hp:int):
        b_.PrependInt16Slot(2, hp, 100)
        return this
    def add_name(name:flatbuffers_offset):
        b_.PrependUOffsetTRelativeSlot(3, name)
        return this
    def add_inventory(inventory:flatbuffers_offset):
        b_.PrependUOffsetTRelativeSlot(5, inventory)
        return this
    def add_color(color:Color):
        b_.PrependUint8Slot(6, color, 8)
        return this
    def add_test_type(test_type:Any):
        b_.PrependUint8Slot(7, test_type, 0)
        return this
    def add_test(test:flatbuffers_offset):
        b_.PrependUOffsetTRelativeSlot(8, test)
        return this
    def add_test4(test4:flatbuffers_offset):
        b_.PrependUOffsetTRelativeSlot(9, test4)
        return this
    def add_testarrayofstring(testarrayofstring:flatbuffers_offset):
        b_.PrependUOffsetTRelativeSlot(10, testarrayofstring)
        return this
    def add_testarrayoftables(testarrayoftables:flatbuffers_offset):
        b_.PrependUOffsetTRelativeSlot(11, testarrayoftables)
        return this
    def add_enemy(enemy:flatbuffers_offset):
        b_.PrependUOffsetTRelativeSlot(12, enemy)
        return this
    def add_testnestedflatbuffer(testnestedflatbuffer:flatbuffers_offset):
        b_.PrependUOffsetTRelativeSlot(13, testnestedflatbuffer)
        return this
    def add_testempty(testempty:flatbuffers_offset):
        b_.PrependUOffsetTRelativeSlot(14, testempty)
        return this
    def add_testbool(testbool:int):
        b_.PrependBoolSlot(15, testbool, 0)
        return this
    def add_testhashs32_fnv1(testhashs32_fnv1:int):
        b_.PrependInt32Slot(16, testhashs32_fnv1, 0)
        return this
    def add_testhashu32_fnv1(testhashu32_fnv1:int):
        b_.PrependUint32Slot(17, testhashu32_fnv1, 0)
        return this
    def add_testhashs64_fnv1(testhashs64_fnv1:int):
        b_.PrependInt64Slot(18, testhashs64_fnv1, 0)
        return this
    def add_testhashu64_fnv1(testhashu64_fnv1:int):
        b_.PrependUint64Slot(19, testhashu64_fnv1, 0)
        return this
    def add_testhashs32_fnv1a(testhashs32_fnv1a:int):
        b_.PrependInt32Slot(20, testhashs32_fnv1a, 0)
        return this
    def add_testhashu32_fnv1a(testhashu32_fnv1a:int):
        b_.PrependUint32Slot(21, testhashu32_fnv1a, 0)
        return this
    def add_testhashs64_fnv1a(testhashs64_fnv1a:int):
        b_.PrependInt64Slot(22, testhashs64_fnv1a, 0)
        return this
    def add_testhashu64_fnv1a(testhashu64_fnv1a:int):
        b_.PrependUint64Slot(23, testhashu64_fnv1a, 0)
        return this
    def add_testarrayofbools(testarrayofbools:flatbuffers_offset):
        b_.PrependUOffsetTRelativeSlot(24, testarrayofbools)
        return this
    def add_testf(testf:float):
        b_.PrependFloat32Slot(25, testf, 3.14159)
        return this
    def add_testf2(testf2:float):
        b_.PrependFloat32Slot(26, testf2, 3.0)
        return this
    def add_testf3(testf3:float):
        b_.PrependFloat32Slot(27, testf3, 0.0)
        return this
    def add_testarrayofstring2(testarrayofstring2:flatbuffers_offset):
        b_.PrependUOffsetTRelativeSlot(28, testarrayofstring2)
        return this
    def add_testarrayofsortedstruct(testarrayofsortedstruct:flatbuffers_offset):
        b_.PrependUOffsetTRelativeSlot(29, testarrayofsortedstruct)
        return this
    def add_flex(flex:flatbuffers_offset):
        b_.PrependUOffsetTRelativeSlot(30, flex)
        return this
    def add_test5(test5:flatbuffers_offset):
        b_.PrependUOffsetTRelativeSlot(31, test5)
        return this
    def add_vector_of_longs(vector_of_longs:flatbuffers_offset):
        b_.PrependUOffsetTRelativeSlot(32, vector_of_longs)
        return this
    def add_vector_of_doubles(vector_of_doubles:flatbuffers_offset):
        b_.PrependUOffsetTRelativeSlot(33, vector_of_doubles)
        return this
    def add_parent_namespace_test(parent_namespace_test:flatbuffers_offset):
        b_.PrependUOffsetTRelativeSlot(34, parent_namespace_test)
        return this
    def add_vector_of_referrables(vector_of_referrables:flatbuffers_offset):
        b_.PrependUOffsetTRelativeSlot(35, vector_of_referrables)
        return this
    def add_single_weak_reference(single_weak_reference:int):
        b_.PrependUint64Slot(36, single_weak_reference, 0)
        return this
    def add_vector_of_weak_references(vector_of_weak_references:flatbuffers_offset):
        b_.PrependUOffsetTRelativeSlot(37, vector_of_weak_references)
        return this
    def add_vector_of_strong_referrables(vector_of_strong_referrables:flatbuffers_offset):
        b_.PrependUOffsetTRelativeSlot(38, vector_of_strong_referrables)
        return this
    def add_co_owning_reference(co_owning_reference:int):
        b_.PrependUint64Slot(39, co_owning_reference, 0)
        return this
    def add_vector_of_co_owning_references(vector_of_co_owning_references:flatbuffers_offset):
        b_.PrependUOffsetTRelativeSlot(40, vector_of_co_owning_references)
        return this
    def add_non_owning_reference(non_owning_reference:int):
        b_.PrependUint64Slot(41, non_owning_reference, 0)
        return this
    def add_vector_of_non_owning_references(vector_of_non_owning_references:flatbuffers_offset):
        b_.PrependUOffsetTRelativeSlot(42, vector_of_non_owning_references)
        return this
    def add_any_unique_type(any_unique_type:AnyUniqueAliases):
        b_.PrependUint8Slot(43, any_unique_type, 0)
        return this
    def add_any_unique(any_unique:flatbuffers_offset):
        b_.PrependUOffsetTRelativeSlot(44, any_unique)
        return this
    def add_any_ambiguous_type(any_ambiguous_type:AnyAmbiguousAliases):
        b_.PrependUint8Slot(45, any_ambiguous_type, 0)
        return this
    def add_any_ambiguous(any_ambiguous:flatbuffers_offset):
        b_.PrependUOffsetTRelativeSlot(46, any_ambiguous)
        return this
    def add_vector_of_enums(vector_of_enums:flatbuffers_offset):
        b_.PrependUOffsetTRelativeSlot(47, vector_of_enums)
        return this
    def add_signed_enum(signed_enum:Race):
        b_.PrependInt8Slot(48, signed_enum, -1)
        return this
    def end():
        return b_.EndObject()

def MonsterStartInventoryVector(b_:flatbuffers_builder, n_:int):
    b_.StartVector(1, n_, 1)
def MonsterCreateInventoryVector(b_:flatbuffers_builder, v_:[int]):
    b_.StartVector(1, v_.length, 1)
    reverse(v_) e_: b_.PrependUint8(e_)
    return b_.EndVector(v_.length)

def MonsterStartTest4Vector(b_:flatbuffers_builder, n_:int):
    b_.StartVector(4, n_, 2)

def MonsterStartTestarrayofstringVector(b_:flatbuffers_builder, n_:int):
    b_.StartVector(4, n_, 4)
def MonsterCreateTestarrayofstringVector(b_:flatbuffers_builder, v_:[flatbuffers_offset]):
    b_.StartVector(4, v_.length, 4)
    reverse(v_) e_: b_.PrependUOffsetTRelative(e_)
    return b_.EndVector(v_.length)

def MonsterStartTestarrayoftablesVector(b_:flatbuffers_builder, n_:int):
    b_.StartVector(4, n_, 4)
def MonsterCreateTestarrayoftablesVector(b_:flatbuffers_builder, v_:[flatbuffers_offset]):
    b_.StartVector(4, v_.length, 4)
    reverse(v_) e_: b_.PrependUOffsetTRelative(e_)
    return b_.EndVector(v_.length)

def MonsterStartTestnestedflatbufferVector(b_:flatbuffers_builder, n_:int):
    b_.StartVector(1, n_, 1)
def MonsterCreateTestnestedflatbufferVector(b_:flatbuffers_builder, v_:[int]):
    b_.StartVector(1, v_.length, 1)
    reverse(v_) e_: b_.PrependUint8(e_)
    return b_.EndVector(v_.length)

def MonsterStartTestarrayofboolsVector(b_:flatbuffers_builder, n_:int):
    b_.StartVector(1, n_, 1)
def MonsterCreateTestarrayofboolsVector(b_:flatbuffers_builder, v_:[int]):
    b_.StartVector(1, v_.length, 1)
    reverse(v_) e_: b_.PrependBool(e_)
    return b_.EndVector(v_.length)

def MonsterStartTestarrayofstring2Vector(b_:flatbuffers_builder, n_:int):
    b_.StartVector(4, n_, 4)
def MonsterCreateTestarrayofstring2Vector(b_:flatbuffers_builder, v_:[flatbuffers_offset]):
    b_.StartVector(4, v_.length, 4)
    reverse(v_) e_: b_.PrependUOffsetTRelative(e_)
    return b_.EndVector(v_.length)

def MonsterStartTestarrayofsortedstructVector(b_:flatbuffers_builder, n_:int):
    b_.StartVector(8, n_, 4)

def MonsterStartFlexVector(b_:flatbuffers_builder, n_:int):
    b_.StartVector(1, n_, 1)
def MonsterCreateFlexVector(b_:flatbuffers_builder, v_:[int]):
    b_.StartVector(1, v_.length, 1)
    reverse(v_) e_: b_.PrependUint8(e_)
    return b_.EndVector(v_.length)

def MonsterStartTest5Vector(b_:flatbuffers_builder, n_:int):
    b_.StartVector(4, n_, 2)

def MonsterStartVectorOfLongsVector(b_:flatbuffers_builder, n_:int):
    b_.StartVector(8, n_, 8)
def MonsterCreateVectorOfLongsVector(b_:flatbuffers_builder, v_:[int]):
    b_.StartVector(8, v_.length, 8)
    reverse(v_) e_: b_.PrependInt64(e_)
    return b_.EndVector(v_.length)

def MonsterStartVectorOfDoublesVector(b_:flatbuffers_builder, n_:int):
    b_.StartVector(8, n_, 8)
def MonsterCreateVectorOfDoublesVector(b_:flatbuffers_builder, v_:[float]):
    b_.StartVector(8, v_.length, 8)
    reverse(v_) e_: b_.PrependFloat64(e_)
    return b_.EndVector(v_.length)

def MonsterStartVectorOfReferrablesVector(b_:flatbuffers_builder, n_:int):
    b_.StartVector(4, n_, 4)
def MonsterCreateVectorOfReferrablesVector(b_:flatbuffers_builder, v_:[flatbuffers_offset]):
    b_.StartVector(4, v_.length, 4)
    reverse(v_) e_: b_.PrependUOffsetTRelative(e_)
    return b_.EndVector(v_.length)

def MonsterStartVectorOfWeakReferencesVector(b_:flatbuffers_builder, n_:int):
    b_.StartVector(8, n_, 8)
def MonsterCreateVectorOfWeakReferencesVector(b_:flatbuffers_builder, v_:[int]):
    b_.StartVector(8, v_.length, 8)
    reverse(v_) e_: b_.PrependUint64(e_)
    return b_.EndVector(v_.length)

def MonsterStartVectorOfStrongReferrablesVector(b_:flatbuffers_builder, n_:int):
    b_.StartVector(4, n_, 4)
def MonsterCreateVectorOfStrongReferrablesVector(b_:flatbuffers_builder, v_:[flatbuffers_offset]):
    b_.StartVector(4, v_.length, 4)
    reverse(v_) e_: b_.PrependUOffsetTRelative(e_)
    return b_.EndVector(v_.length)

def MonsterStartVectorOfCoOwningReferencesVector(b_:flatbuffers_builder, n_:int):
    b_.StartVector(8, n_, 8)
def MonsterCreateVectorOfCoOwningReferencesVector(b_:flatbuffers_builder, v_:[int]):
    b_.StartVector(8, v_.length, 8)
    reverse(v_) e_: b_.PrependUint64(e_)
    return b_.EndVector(v_.length)

def MonsterStartVectorOfNonOwningReferencesVector(b_:flatbuffers_builder, n_:int):
    b_.StartVector(8, n_, 8)
def MonsterCreateVectorOfNonOwningReferencesVector(b_:flatbuffers_builder, v_:[int]):
    b_.StartVector(8, v_.length, 8)
    reverse(v_) e_: b_.PrependUint64(e_)
    return b_.EndVector(v_.length)

def MonsterStartVectorOfEnumsVector(b_:flatbuffers_builder, n_:int):
    b_.StartVector(1, n_, 1)
def MonsterCreateVectorOfEnumsVector(b_:flatbuffers_builder, v_:[Color]):
    b_.StartVector(1, v_.length, 1)
    reverse(v_) e_: b_.PrependUint8(e_)
    return b_.EndVector(v_.length)

class TypeAliases : flatbuffers_handle
    def i8():
        return buf_.flatbuffers_field_int8(pos_, 4, 0)
    def u8():
        return buf_.flatbuffers_field_int8(pos_, 6, 0)
    def i16():
        return buf_.flatbuffers_field_int16(pos_, 8, 0)
    def u16():
        return buf_.flatbuffers_field_int16(pos_, 10, 0)
    def i32():
        return buf_.flatbuffers_field_int32(pos_, 12, 0)
    def u32():
        return buf_.flatbuffers_field_int32(pos_, 14, 0)
    def i64():
        return buf_.flatbuffers_field_int64(pos_, 16, 0)
    def u64():
        return buf_.flatbuffers_field_int64(pos_, 18, 0)
    def f32():
        return buf_.flatbuffers_field_float32(pos_, 20, 0.0)
    def f64():
        return buf_.flatbuffers_field_float64(pos_, 22, 0.0)
    def v8(i:int):
        return buf_.read_int8_le(buf_.flatbuffers_field_vector(pos_, 24) + i * 1)
    def v8_length():
        return buf_.flatbuffers_field_vector_len(pos_, 24)
    def vf64(i:int):
        return buf_.read_float64_le(buf_.flatbuffers_field_vector(pos_, 26) + i * 8)
    def vf64_length():
        return buf_.flatbuffers_field_vector_len(pos_, 26)

def GetRootAsTypeAliases(buf:string): return TypeAliases { buf, buf.flatbuffers_indirect(0) }

struct TypeAliasesBuilder:
    b_:flatbuffers_builder
    def start():
        b_.StartObject(12)
        return this
    def add_i8(i8:int):
        b_.PrependInt8Slot(0, i8, 0)
        return this
    def add_u8(u8:int):
        b_.PrependUint8Slot(1, u8, 0)
        return this
    def add_i16(i16:int):
        b_.PrependInt16Slot(2, i16, 0)
        return this
    def add_u16(u16:int):
        b_.PrependUint16Slot(3, u16, 0)
        return this
    def add_i32(i32:int):
        b_.PrependInt32Slot(4, i32, 0)
        return this
    def add_u32(u32:int):
        b_.PrependUint32Slot(5, u32, 0)
        return this
    def add_i64(i64:int):
        b_.PrependInt64Slot(6, i64, 0)
        return this
    def add_u64(u64:int):
        b_.PrependUint64Slot(7, u64, 0)
        return this
    def add_f32(f32:float):
        b_.PrependFloat32Slot(8, f32, 0.0)
        return this
    def add_f64(f64:float):
        b_.PrependFloat64Slot(9, f64, 0.0)
        return this
    def add_v8(v8:flatbuffers_offset):
        b_.PrependUOffsetTRelativeSlot(10, v8)
        return this
    def add_vf64(vf64:flatbuffers_offset):
        b_.PrependUOffsetTRelativeSlot(11, vf64)
        return this
    def end():
        return b_.EndObject()

def TypeAliasesStartV8Vector(b_:flatbuffers_builder, n_:int):
    b_.StartVector(1, n_, 1)
def TypeAliasesCreateV8Vector(b_:flatbuffers_builder, v_:[int]):
    b_.StartVector(1, v_.length, 1)
    reverse(v_) e_: b_.PrependInt8(e_)
    return b_.EndVector(v_.length)

def TypeAliasesStartVf64Vector(b_:flatbuffers_builder, n_:int):
    b_.StartVector(8, n_, 8)
def TypeAliasesCreateVf64Vector(b_:flatbuffers_builder, v_:[float]):
    b_.StartVector(8, v_.length, 8)
    reverse(v_) e_: b_.PrependFloat64(e_)
    return b_.EndVector(v_.length)