...

Text file src/github.com/google/flatbuffers/tests/ts/my-game/example/monster.ts

Documentation: github.com/google/flatbuffers/tests/ts/my-game/example

     1// automatically generated by the FlatBuffers compiler, do not modify
     2
     3import * as flatbuffers from 'flatbuffers';
     4
     5import { Monster as MyGame_Example2_Monster, MonsterT as MyGame_Example2_MonsterT } from '../../my-game/example2/monster.js';
     6import { Ability, AbilityT } from '../../my-game/example/ability.js';
     7import { Any, unionToAny, unionListToAny } from '../../my-game/example/any.js';
     8import { AnyAmbiguousAliases, unionToAnyAmbiguousAliases, unionListToAnyAmbiguousAliases } from '../../my-game/example/any-ambiguous-aliases.js';
     9import { AnyUniqueAliases, unionToAnyUniqueAliases, unionListToAnyUniqueAliases } from '../../my-game/example/any-unique-aliases.js';
    10import { Color } from '../../my-game/example/color.js';
    11import { Race } from '../../my-game/example/race.js';
    12import { Referrable, ReferrableT } from '../../my-game/example/referrable.js';
    13import { Stat, StatT } from '../../my-game/example/stat.js';
    14import { Test, TestT } from '../../my-game/example/test.js';
    15import { TestSimpleTableWithEnum, TestSimpleTableWithEnumT } from '../../my-game/example/test-simple-table-with-enum.js';
    16import { Vec3, Vec3T } from '../../my-game/example/vec3.js';
    17import { InParentNamespace, InParentNamespaceT } from '../../my-game/in-parent-namespace.js';
    18
    19
    20/**
    21 * an example documentation comment: "monster object"
    22 */
    23export class Monster implements flatbuffers.IUnpackableObject<MonsterT> {
    24  bb: flatbuffers.ByteBuffer|null = null;
    25  bb_pos = 0;
    26  __init(i:number, bb:flatbuffers.ByteBuffer):Monster {
    27  this.bb_pos = i;
    28  this.bb = bb;
    29  return this;
    30}
    31
    32static getRootAsMonster(bb:flatbuffers.ByteBuffer, obj?:Monster):Monster {
    33  return (obj || new Monster()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    34}
    35
    36static getSizePrefixedRootAsMonster(bb:flatbuffers.ByteBuffer, obj?:Monster):Monster {
    37  bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
    38  return (obj || new Monster()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    39}
    40
    41static bufferHasIdentifier(bb:flatbuffers.ByteBuffer):boolean {
    42  return bb.__has_identifier('MONS');
    43}
    44
    45pos(obj?:Vec3):Vec3|null {
    46  const offset = this.bb!.__offset(this.bb_pos, 4);
    47  return offset ? (obj || new Vec3()).__init(this.bb_pos + offset, this.bb!) : null;
    48}
    49
    50mana():number {
    51  const offset = this.bb!.__offset(this.bb_pos, 6);
    52  return offset ? this.bb!.readInt16(this.bb_pos + offset) : 150;
    53}
    54
    55mutate_mana(value:number):boolean {
    56  const offset = this.bb!.__offset(this.bb_pos, 6);
    57
    58  if (offset === 0) {
    59    return false;
    60  }
    61
    62  this.bb!.writeInt16(this.bb_pos + offset, value);
    63  return true;
    64}
    65
    66hp():number {
    67  const offset = this.bb!.__offset(this.bb_pos, 8);
    68  return offset ? this.bb!.readInt16(this.bb_pos + offset) : 100;
    69}
    70
    71mutate_hp(value:number):boolean {
    72  const offset = this.bb!.__offset(this.bb_pos, 8);
    73
    74  if (offset === 0) {
    75    return false;
    76  }
    77
    78  this.bb!.writeInt16(this.bb_pos + offset, value);
    79  return true;
    80}
    81
    82name():string|null
    83name(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
    84name(optionalEncoding?:any):string|Uint8Array|null {
    85  const offset = this.bb!.__offset(this.bb_pos, 10);
    86  return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
    87}
    88
    89inventory(index: number):number|null {
    90  const offset = this.bb!.__offset(this.bb_pos, 14);
    91  return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0;
    92}
    93
    94inventoryLength():number {
    95  const offset = this.bb!.__offset(this.bb_pos, 14);
    96  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
    97}
    98
    99inventoryArray():Uint8Array|null {
   100  const offset = this.bb!.__offset(this.bb_pos, 14);
   101  return offset ? new Uint8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
   102}
   103
   104color():Color {
   105  const offset = this.bb!.__offset(this.bb_pos, 16);
   106  return offset ? this.bb!.readUint8(this.bb_pos + offset) : Color.Blue;
   107}
   108
   109mutate_color(value:Color):boolean {
   110  const offset = this.bb!.__offset(this.bb_pos, 16);
   111
   112  if (offset === 0) {
   113    return false;
   114  }
   115
   116  this.bb!.writeUint8(this.bb_pos + offset, value);
   117  return true;
   118}
   119
   120testType():Any {
   121  const offset = this.bb!.__offset(this.bb_pos, 18);
   122  return offset ? this.bb!.readUint8(this.bb_pos + offset) : Any.NONE;
   123}
   124
   125test<T extends flatbuffers.Table>(obj:any):any|null {
   126  const offset = this.bb!.__offset(this.bb_pos, 20);
   127  return offset ? this.bb!.__union(obj, this.bb_pos + offset) : null;
   128}
   129
   130test4(index: number, obj?:Test):Test|null {
   131  const offset = this.bb!.__offset(this.bb_pos, 22);
   132  return offset ? (obj || new Test()).__init(this.bb!.__vector(this.bb_pos + offset) + index * 4, this.bb!) : null;
   133}
   134
   135test4Length():number {
   136  const offset = this.bb!.__offset(this.bb_pos, 22);
   137  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
   138}
   139
   140testarrayofstring(index: number):string
   141testarrayofstring(index: number,optionalEncoding:flatbuffers.Encoding):string|Uint8Array
   142testarrayofstring(index: number,optionalEncoding?:any):string|Uint8Array|null {
   143  const offset = this.bb!.__offset(this.bb_pos, 24);
   144  return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
   145}
   146
   147testarrayofstringLength():number {
   148  const offset = this.bb!.__offset(this.bb_pos, 24);
   149  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
   150}
   151
   152/**
   153 * an example documentation comment: this will end up in the generated code
   154 * multiline too
   155 */
   156testarrayoftables(index: number, obj?:Monster):Monster|null {
   157  const offset = this.bb!.__offset(this.bb_pos, 26);
   158  return offset ? (obj || new Monster()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
   159}
   160
   161testarrayoftablesLength():number {
   162  const offset = this.bb!.__offset(this.bb_pos, 26);
   163  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
   164}
   165
   166enemy(obj?:Monster):Monster|null {
   167  const offset = this.bb!.__offset(this.bb_pos, 28);
   168  return offset ? (obj || new Monster()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
   169}
   170
   171testnestedflatbuffer(index: number):number|null {
   172  const offset = this.bb!.__offset(this.bb_pos, 30);
   173  return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0;
   174}
   175
   176testnestedflatbufferLength():number {
   177  const offset = this.bb!.__offset(this.bb_pos, 30);
   178  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
   179}
   180
   181testnestedflatbufferArray():Uint8Array|null {
   182  const offset = this.bb!.__offset(this.bb_pos, 30);
   183  return offset ? new Uint8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
   184}
   185
   186testempty(obj?:Stat):Stat|null {
   187  const offset = this.bb!.__offset(this.bb_pos, 32);
   188  return offset ? (obj || new Stat()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
   189}
   190
   191testbool():boolean {
   192  const offset = this.bb!.__offset(this.bb_pos, 34);
   193  return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
   194}
   195
   196mutate_testbool(value:boolean):boolean {
   197  const offset = this.bb!.__offset(this.bb_pos, 34);
   198
   199  if (offset === 0) {
   200    return false;
   201  }
   202
   203  this.bb!.writeInt8(this.bb_pos + offset, +value);
   204  return true;
   205}
   206
   207testhashs32Fnv1():number {
   208  const offset = this.bb!.__offset(this.bb_pos, 36);
   209  return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
   210}
   211
   212mutate_testhashs32_fnv1(value:number):boolean {
   213  const offset = this.bb!.__offset(this.bb_pos, 36);
   214
   215  if (offset === 0) {
   216    return false;
   217  }
   218
   219  this.bb!.writeInt32(this.bb_pos + offset, value);
   220  return true;
   221}
   222
   223testhashu32Fnv1():number {
   224  const offset = this.bb!.__offset(this.bb_pos, 38);
   225  return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;
   226}
   227
   228mutate_testhashu32_fnv1(value:number):boolean {
   229  const offset = this.bb!.__offset(this.bb_pos, 38);
   230
   231  if (offset === 0) {
   232    return false;
   233  }
   234
   235  this.bb!.writeUint32(this.bb_pos + offset, value);
   236  return true;
   237}
   238
   239testhashs64Fnv1():bigint {
   240  const offset = this.bb!.__offset(this.bb_pos, 40);
   241  return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0');
   242}
   243
   244mutate_testhashs64_fnv1(value:bigint):boolean {
   245  const offset = this.bb!.__offset(this.bb_pos, 40);
   246
   247  if (offset === 0) {
   248    return false;
   249  }
   250
   251  this.bb!.writeInt64(this.bb_pos + offset, value);
   252  return true;
   253}
   254
   255testhashu64Fnv1():bigint {
   256  const offset = this.bb!.__offset(this.bb_pos, 42);
   257  return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0');
   258}
   259
   260mutate_testhashu64_fnv1(value:bigint):boolean {
   261  const offset = this.bb!.__offset(this.bb_pos, 42);
   262
   263  if (offset === 0) {
   264    return false;
   265  }
   266
   267  this.bb!.writeUint64(this.bb_pos + offset, value);
   268  return true;
   269}
   270
   271testhashs32Fnv1a():number {
   272  const offset = this.bb!.__offset(this.bb_pos, 44);
   273  return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
   274}
   275
   276mutate_testhashs32_fnv1a(value:number):boolean {
   277  const offset = this.bb!.__offset(this.bb_pos, 44);
   278
   279  if (offset === 0) {
   280    return false;
   281  }
   282
   283  this.bb!.writeInt32(this.bb_pos + offset, value);
   284  return true;
   285}
   286
   287testhashu32Fnv1a():number {
   288  const offset = this.bb!.__offset(this.bb_pos, 46);
   289  return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;
   290}
   291
   292mutate_testhashu32_fnv1a(value:number):boolean {
   293  const offset = this.bb!.__offset(this.bb_pos, 46);
   294
   295  if (offset === 0) {
   296    return false;
   297  }
   298
   299  this.bb!.writeUint32(this.bb_pos + offset, value);
   300  return true;
   301}
   302
   303testhashs64Fnv1a():bigint {
   304  const offset = this.bb!.__offset(this.bb_pos, 48);
   305  return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0');
   306}
   307
   308mutate_testhashs64_fnv1a(value:bigint):boolean {
   309  const offset = this.bb!.__offset(this.bb_pos, 48);
   310
   311  if (offset === 0) {
   312    return false;
   313  }
   314
   315  this.bb!.writeInt64(this.bb_pos + offset, value);
   316  return true;
   317}
   318
   319testhashu64Fnv1a():bigint {
   320  const offset = this.bb!.__offset(this.bb_pos, 50);
   321  return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0');
   322}
   323
   324mutate_testhashu64_fnv1a(value:bigint):boolean {
   325  const offset = this.bb!.__offset(this.bb_pos, 50);
   326
   327  if (offset === 0) {
   328    return false;
   329  }
   330
   331  this.bb!.writeUint64(this.bb_pos + offset, value);
   332  return true;
   333}
   334
   335testarrayofbools(index: number):boolean|null {
   336  const offset = this.bb!.__offset(this.bb_pos, 52);
   337  return offset ? !!this.bb!.readInt8(this.bb!.__vector(this.bb_pos + offset) + index) : false;
   338}
   339
   340testarrayofboolsLength():number {
   341  const offset = this.bb!.__offset(this.bb_pos, 52);
   342  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
   343}
   344
   345testarrayofboolsArray():Int8Array|null {
   346  const offset = this.bb!.__offset(this.bb_pos, 52);
   347  return offset ? new Int8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
   348}
   349
   350testf():number {
   351  const offset = this.bb!.__offset(this.bb_pos, 54);
   352  return offset ? this.bb!.readFloat32(this.bb_pos + offset) : 3.14159;
   353}
   354
   355mutate_testf(value:number):boolean {
   356  const offset = this.bb!.__offset(this.bb_pos, 54);
   357
   358  if (offset === 0) {
   359    return false;
   360  }
   361
   362  this.bb!.writeFloat32(this.bb_pos + offset, value);
   363  return true;
   364}
   365
   366testf2():number {
   367  const offset = this.bb!.__offset(this.bb_pos, 56);
   368  return offset ? this.bb!.readFloat32(this.bb_pos + offset) : 3.0;
   369}
   370
   371mutate_testf2(value:number):boolean {
   372  const offset = this.bb!.__offset(this.bb_pos, 56);
   373
   374  if (offset === 0) {
   375    return false;
   376  }
   377
   378  this.bb!.writeFloat32(this.bb_pos + offset, value);
   379  return true;
   380}
   381
   382testf3():number {
   383  const offset = this.bb!.__offset(this.bb_pos, 58);
   384  return offset ? this.bb!.readFloat32(this.bb_pos + offset) : 0.0;
   385}
   386
   387mutate_testf3(value:number):boolean {
   388  const offset = this.bb!.__offset(this.bb_pos, 58);
   389
   390  if (offset === 0) {
   391    return false;
   392  }
   393
   394  this.bb!.writeFloat32(this.bb_pos + offset, value);
   395  return true;
   396}
   397
   398testarrayofstring2(index: number):string
   399testarrayofstring2(index: number,optionalEncoding:flatbuffers.Encoding):string|Uint8Array
   400testarrayofstring2(index: number,optionalEncoding?:any):string|Uint8Array|null {
   401  const offset = this.bb!.__offset(this.bb_pos, 60);
   402  return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
   403}
   404
   405testarrayofstring2Length():number {
   406  const offset = this.bb!.__offset(this.bb_pos, 60);
   407  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
   408}
   409
   410testarrayofsortedstruct(index: number, obj?:Ability):Ability|null {
   411  const offset = this.bb!.__offset(this.bb_pos, 62);
   412  return offset ? (obj || new Ability()).__init(this.bb!.__vector(this.bb_pos + offset) + index * 8, this.bb!) : null;
   413}
   414
   415testarrayofsortedstructLength():number {
   416  const offset = this.bb!.__offset(this.bb_pos, 62);
   417  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
   418}
   419
   420flex(index: number):number|null {
   421  const offset = this.bb!.__offset(this.bb_pos, 64);
   422  return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0;
   423}
   424
   425flexLength():number {
   426  const offset = this.bb!.__offset(this.bb_pos, 64);
   427  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
   428}
   429
   430flexArray():Uint8Array|null {
   431  const offset = this.bb!.__offset(this.bb_pos, 64);
   432  return offset ? new Uint8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
   433}
   434
   435test5(index: number, obj?:Test):Test|null {
   436  const offset = this.bb!.__offset(this.bb_pos, 66);
   437  return offset ? (obj || new Test()).__init(this.bb!.__vector(this.bb_pos + offset) + index * 4, this.bb!) : null;
   438}
   439
   440test5Length():number {
   441  const offset = this.bb!.__offset(this.bb_pos, 66);
   442  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
   443}
   444
   445vectorOfLongs(index: number):bigint|null {
   446  const offset = this.bb!.__offset(this.bb_pos, 68);
   447  return offset ? this.bb!.readInt64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : BigInt(0);
   448}
   449
   450vectorOfLongsLength():number {
   451  const offset = this.bb!.__offset(this.bb_pos, 68);
   452  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
   453}
   454
   455vectorOfDoubles(index: number):number|null {
   456  const offset = this.bb!.__offset(this.bb_pos, 70);
   457  return offset ? this.bb!.readFloat64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : 0;
   458}
   459
   460vectorOfDoublesLength():number {
   461  const offset = this.bb!.__offset(this.bb_pos, 70);
   462  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
   463}
   464
   465vectorOfDoublesArray():Float64Array|null {
   466  const offset = this.bb!.__offset(this.bb_pos, 70);
   467  return offset ? new Float64Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
   468}
   469
   470parentNamespaceTest(obj?:InParentNamespace):InParentNamespace|null {
   471  const offset = this.bb!.__offset(this.bb_pos, 72);
   472  return offset ? (obj || new InParentNamespace()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
   473}
   474
   475vectorOfReferrables(index: number, obj?:Referrable):Referrable|null {
   476  const offset = this.bb!.__offset(this.bb_pos, 74);
   477  return offset ? (obj || new Referrable()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
   478}
   479
   480vectorOfReferrablesLength():number {
   481  const offset = this.bb!.__offset(this.bb_pos, 74);
   482  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
   483}
   484
   485singleWeakReference():bigint {
   486  const offset = this.bb!.__offset(this.bb_pos, 76);
   487  return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0');
   488}
   489
   490mutate_single_weak_reference(value:bigint):boolean {
   491  const offset = this.bb!.__offset(this.bb_pos, 76);
   492
   493  if (offset === 0) {
   494    return false;
   495  }
   496
   497  this.bb!.writeUint64(this.bb_pos + offset, value);
   498  return true;
   499}
   500
   501vectorOfWeakReferences(index: number):bigint|null {
   502  const offset = this.bb!.__offset(this.bb_pos, 78);
   503  return offset ? this.bb!.readUint64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : BigInt(0);
   504}
   505
   506vectorOfWeakReferencesLength():number {
   507  const offset = this.bb!.__offset(this.bb_pos, 78);
   508  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
   509}
   510
   511vectorOfStrongReferrables(index: number, obj?:Referrable):Referrable|null {
   512  const offset = this.bb!.__offset(this.bb_pos, 80);
   513  return offset ? (obj || new Referrable()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
   514}
   515
   516vectorOfStrongReferrablesLength():number {
   517  const offset = this.bb!.__offset(this.bb_pos, 80);
   518  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
   519}
   520
   521coOwningReference():bigint {
   522  const offset = this.bb!.__offset(this.bb_pos, 82);
   523  return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0');
   524}
   525
   526mutate_co_owning_reference(value:bigint):boolean {
   527  const offset = this.bb!.__offset(this.bb_pos, 82);
   528
   529  if (offset === 0) {
   530    return false;
   531  }
   532
   533  this.bb!.writeUint64(this.bb_pos + offset, value);
   534  return true;
   535}
   536
   537vectorOfCoOwningReferences(index: number):bigint|null {
   538  const offset = this.bb!.__offset(this.bb_pos, 84);
   539  return offset ? this.bb!.readUint64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : BigInt(0);
   540}
   541
   542vectorOfCoOwningReferencesLength():number {
   543  const offset = this.bb!.__offset(this.bb_pos, 84);
   544  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
   545}
   546
   547nonOwningReference():bigint {
   548  const offset = this.bb!.__offset(this.bb_pos, 86);
   549  return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0');
   550}
   551
   552mutate_non_owning_reference(value:bigint):boolean {
   553  const offset = this.bb!.__offset(this.bb_pos, 86);
   554
   555  if (offset === 0) {
   556    return false;
   557  }
   558
   559  this.bb!.writeUint64(this.bb_pos + offset, value);
   560  return true;
   561}
   562
   563vectorOfNonOwningReferences(index: number):bigint|null {
   564  const offset = this.bb!.__offset(this.bb_pos, 88);
   565  return offset ? this.bb!.readUint64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : BigInt(0);
   566}
   567
   568vectorOfNonOwningReferencesLength():number {
   569  const offset = this.bb!.__offset(this.bb_pos, 88);
   570  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
   571}
   572
   573anyUniqueType():AnyUniqueAliases {
   574  const offset = this.bb!.__offset(this.bb_pos, 90);
   575  return offset ? this.bb!.readUint8(this.bb_pos + offset) : AnyUniqueAliases.NONE;
   576}
   577
   578anyUnique<T extends flatbuffers.Table>(obj:any):any|null {
   579  const offset = this.bb!.__offset(this.bb_pos, 92);
   580  return offset ? this.bb!.__union(obj, this.bb_pos + offset) : null;
   581}
   582
   583anyAmbiguousType():AnyAmbiguousAliases {
   584  const offset = this.bb!.__offset(this.bb_pos, 94);
   585  return offset ? this.bb!.readUint8(this.bb_pos + offset) : AnyAmbiguousAliases.NONE;
   586}
   587
   588anyAmbiguous<T extends flatbuffers.Table>(obj:any):any|null {
   589  const offset = this.bb!.__offset(this.bb_pos, 96);
   590  return offset ? this.bb!.__union(obj, this.bb_pos + offset) : null;
   591}
   592
   593vectorOfEnums(index: number):Color|null {
   594  const offset = this.bb!.__offset(this.bb_pos, 98);
   595  return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0;
   596}
   597
   598vectorOfEnumsLength():number {
   599  const offset = this.bb!.__offset(this.bb_pos, 98);
   600  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
   601}
   602
   603vectorOfEnumsArray():Uint8Array|null {
   604  const offset = this.bb!.__offset(this.bb_pos, 98);
   605  return offset ? new Uint8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
   606}
   607
   608signedEnum():Race {
   609  const offset = this.bb!.__offset(this.bb_pos, 100);
   610  return offset ? this.bb!.readInt8(this.bb_pos + offset) : Race.None;
   611}
   612
   613mutate_signed_enum(value:Race):boolean {
   614  const offset = this.bb!.__offset(this.bb_pos, 100);
   615
   616  if (offset === 0) {
   617    return false;
   618  }
   619
   620  this.bb!.writeInt8(this.bb_pos + offset, value);
   621  return true;
   622}
   623
   624testrequirednestedflatbuffer(index: number):number|null {
   625  const offset = this.bb!.__offset(this.bb_pos, 102);
   626  return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0;
   627}
   628
   629testrequirednestedflatbufferLength():number {
   630  const offset = this.bb!.__offset(this.bb_pos, 102);
   631  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
   632}
   633
   634testrequirednestedflatbufferArray():Uint8Array|null {
   635  const offset = this.bb!.__offset(this.bb_pos, 102);
   636  return offset ? new Uint8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
   637}
   638
   639scalarKeySortedTables(index: number, obj?:Stat):Stat|null {
   640  const offset = this.bb!.__offset(this.bb_pos, 104);
   641  return offset ? (obj || new Stat()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
   642}
   643
   644scalarKeySortedTablesLength():number {
   645  const offset = this.bb!.__offset(this.bb_pos, 104);
   646  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
   647}
   648
   649nativeInline(obj?:Test):Test|null {
   650  const offset = this.bb!.__offset(this.bb_pos, 106);
   651  return offset ? (obj || new Test()).__init(this.bb_pos + offset, this.bb!) : null;
   652}
   653
   654longEnumNonEnumDefault():bigint {
   655  const offset = this.bb!.__offset(this.bb_pos, 108);
   656  return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0');
   657}
   658
   659mutate_long_enum_non_enum_default(value:bigint):boolean {
   660  const offset = this.bb!.__offset(this.bb_pos, 108);
   661
   662  if (offset === 0) {
   663    return false;
   664  }
   665
   666  this.bb!.writeUint64(this.bb_pos + offset, value);
   667  return true;
   668}
   669
   670longEnumNormalDefault():bigint {
   671  const offset = this.bb!.__offset(this.bb_pos, 110);
   672  return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('2');
   673}
   674
   675mutate_long_enum_normal_default(value:bigint):boolean {
   676  const offset = this.bb!.__offset(this.bb_pos, 110);
   677
   678  if (offset === 0) {
   679    return false;
   680  }
   681
   682  this.bb!.writeUint64(this.bb_pos + offset, value);
   683  return true;
   684}
   685
   686nanDefault():number {
   687  const offset = this.bb!.__offset(this.bb_pos, 112);
   688  return offset ? this.bb!.readFloat32(this.bb_pos + offset) : NaN;
   689}
   690
   691mutate_nan_default(value:number):boolean {
   692  const offset = this.bb!.__offset(this.bb_pos, 112);
   693
   694  if (offset === 0) {
   695    return false;
   696  }
   697
   698  this.bb!.writeFloat32(this.bb_pos + offset, value);
   699  return true;
   700}
   701
   702infDefault():number {
   703  const offset = this.bb!.__offset(this.bb_pos, 114);
   704  return offset ? this.bb!.readFloat32(this.bb_pos + offset) : Infinity;
   705}
   706
   707mutate_inf_default(value:number):boolean {
   708  const offset = this.bb!.__offset(this.bb_pos, 114);
   709
   710  if (offset === 0) {
   711    return false;
   712  }
   713
   714  this.bb!.writeFloat32(this.bb_pos + offset, value);
   715  return true;
   716}
   717
   718positiveInfDefault():number {
   719  const offset = this.bb!.__offset(this.bb_pos, 116);
   720  return offset ? this.bb!.readFloat32(this.bb_pos + offset) : Infinity;
   721}
   722
   723mutate_positive_inf_default(value:number):boolean {
   724  const offset = this.bb!.__offset(this.bb_pos, 116);
   725
   726  if (offset === 0) {
   727    return false;
   728  }
   729
   730  this.bb!.writeFloat32(this.bb_pos + offset, value);
   731  return true;
   732}
   733
   734infinityDefault():number {
   735  const offset = this.bb!.__offset(this.bb_pos, 118);
   736  return offset ? this.bb!.readFloat32(this.bb_pos + offset) : Infinity;
   737}
   738
   739mutate_infinity_default(value:number):boolean {
   740  const offset = this.bb!.__offset(this.bb_pos, 118);
   741
   742  if (offset === 0) {
   743    return false;
   744  }
   745
   746  this.bb!.writeFloat32(this.bb_pos + offset, value);
   747  return true;
   748}
   749
   750positiveInfinityDefault():number {
   751  const offset = this.bb!.__offset(this.bb_pos, 120);
   752  return offset ? this.bb!.readFloat32(this.bb_pos + offset) : Infinity;
   753}
   754
   755mutate_positive_infinity_default(value:number):boolean {
   756  const offset = this.bb!.__offset(this.bb_pos, 120);
   757
   758  if (offset === 0) {
   759    return false;
   760  }
   761
   762  this.bb!.writeFloat32(this.bb_pos + offset, value);
   763  return true;
   764}
   765
   766negativeInfDefault():number {
   767  const offset = this.bb!.__offset(this.bb_pos, 122);
   768  return offset ? this.bb!.readFloat32(this.bb_pos + offset) : -Infinity;
   769}
   770
   771mutate_negative_inf_default(value:number):boolean {
   772  const offset = this.bb!.__offset(this.bb_pos, 122);
   773
   774  if (offset === 0) {
   775    return false;
   776  }
   777
   778  this.bb!.writeFloat32(this.bb_pos + offset, value);
   779  return true;
   780}
   781
   782negativeInfinityDefault():number {
   783  const offset = this.bb!.__offset(this.bb_pos, 124);
   784  return offset ? this.bb!.readFloat32(this.bb_pos + offset) : -Infinity;
   785}
   786
   787mutate_negative_infinity_default(value:number):boolean {
   788  const offset = this.bb!.__offset(this.bb_pos, 124);
   789
   790  if (offset === 0) {
   791    return false;
   792  }
   793
   794  this.bb!.writeFloat32(this.bb_pos + offset, value);
   795  return true;
   796}
   797
   798doubleInfDefault():number {
   799  const offset = this.bb!.__offset(this.bb_pos, 126);
   800  return offset ? this.bb!.readFloat64(this.bb_pos + offset) : Infinity;
   801}
   802
   803mutate_double_inf_default(value:number):boolean {
   804  const offset = this.bb!.__offset(this.bb_pos, 126);
   805
   806  if (offset === 0) {
   807    return false;
   808  }
   809
   810  this.bb!.writeFloat64(this.bb_pos + offset, value);
   811  return true;
   812}
   813
   814static getFullyQualifiedName():string {
   815  return 'MyGame.Example.Monster';
   816}
   817
   818static startMonster(builder:flatbuffers.Builder) {
   819  builder.startObject(62);
   820}
   821
   822static addPos(builder:flatbuffers.Builder, posOffset:flatbuffers.Offset) {
   823  builder.addFieldStruct(0, posOffset, 0);
   824}
   825
   826static addMana(builder:flatbuffers.Builder, mana:number) {
   827  builder.addFieldInt16(1, mana, 150);
   828}
   829
   830static addHp(builder:flatbuffers.Builder, hp:number) {
   831  builder.addFieldInt16(2, hp, 100);
   832}
   833
   834static addName(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset) {
   835  builder.addFieldOffset(3, nameOffset, 0);
   836}
   837
   838static addInventory(builder:flatbuffers.Builder, inventoryOffset:flatbuffers.Offset) {
   839  builder.addFieldOffset(5, inventoryOffset, 0);
   840}
   841
   842static createInventoryVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset {
   843  builder.startVector(1, data.length, 1);
   844  for (let i = data.length - 1; i >= 0; i--) {
   845    builder.addInt8(data[i]!);
   846  }
   847  return builder.endVector();
   848}
   849
   850static startInventoryVector(builder:flatbuffers.Builder, numElems:number) {
   851  builder.startVector(1, numElems, 1);
   852}
   853
   854static addColor(builder:flatbuffers.Builder, color:Color) {
   855  builder.addFieldInt8(6, color, Color.Blue);
   856}
   857
   858static addTestType(builder:flatbuffers.Builder, testType:Any) {
   859  builder.addFieldInt8(7, testType, Any.NONE);
   860}
   861
   862static addTest(builder:flatbuffers.Builder, testOffset:flatbuffers.Offset) {
   863  builder.addFieldOffset(8, testOffset, 0);
   864}
   865
   866static addTest4(builder:flatbuffers.Builder, test4Offset:flatbuffers.Offset) {
   867  builder.addFieldOffset(9, test4Offset, 0);
   868}
   869
   870static startTest4Vector(builder:flatbuffers.Builder, numElems:number) {
   871  builder.startVector(4, numElems, 2);
   872}
   873
   874static addTestarrayofstring(builder:flatbuffers.Builder, testarrayofstringOffset:flatbuffers.Offset) {
   875  builder.addFieldOffset(10, testarrayofstringOffset, 0);
   876}
   877
   878static createTestarrayofstringVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
   879  builder.startVector(4, data.length, 4);
   880  for (let i = data.length - 1; i >= 0; i--) {
   881    builder.addOffset(data[i]!);
   882  }
   883  return builder.endVector();
   884}
   885
   886static startTestarrayofstringVector(builder:flatbuffers.Builder, numElems:number) {
   887  builder.startVector(4, numElems, 4);
   888}
   889
   890static addTestarrayoftables(builder:flatbuffers.Builder, testarrayoftablesOffset:flatbuffers.Offset) {
   891  builder.addFieldOffset(11, testarrayoftablesOffset, 0);
   892}
   893
   894static createTestarrayoftablesVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
   895  builder.startVector(4, data.length, 4);
   896  for (let i = data.length - 1; i >= 0; i--) {
   897    builder.addOffset(data[i]!);
   898  }
   899  return builder.endVector();
   900}
   901
   902static startTestarrayoftablesVector(builder:flatbuffers.Builder, numElems:number) {
   903  builder.startVector(4, numElems, 4);
   904}
   905
   906static addEnemy(builder:flatbuffers.Builder, enemyOffset:flatbuffers.Offset) {
   907  builder.addFieldOffset(12, enemyOffset, 0);
   908}
   909
   910static addTestnestedflatbuffer(builder:flatbuffers.Builder, testnestedflatbufferOffset:flatbuffers.Offset) {
   911  builder.addFieldOffset(13, testnestedflatbufferOffset, 0);
   912}
   913
   914static createTestnestedflatbufferVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset {
   915  builder.startVector(1, data.length, 1);
   916  for (let i = data.length - 1; i >= 0; i--) {
   917    builder.addInt8(data[i]!);
   918  }
   919  return builder.endVector();
   920}
   921
   922static startTestnestedflatbufferVector(builder:flatbuffers.Builder, numElems:number) {
   923  builder.startVector(1, numElems, 1);
   924}
   925
   926static addTestempty(builder:flatbuffers.Builder, testemptyOffset:flatbuffers.Offset) {
   927  builder.addFieldOffset(14, testemptyOffset, 0);
   928}
   929
   930static addTestbool(builder:flatbuffers.Builder, testbool:boolean) {
   931  builder.addFieldInt8(15, +testbool, +false);
   932}
   933
   934static addTesthashs32Fnv1(builder:flatbuffers.Builder, testhashs32Fnv1:number) {
   935  builder.addFieldInt32(16, testhashs32Fnv1, 0);
   936}
   937
   938static addTesthashu32Fnv1(builder:flatbuffers.Builder, testhashu32Fnv1:number) {
   939  builder.addFieldInt32(17, testhashu32Fnv1, 0);
   940}
   941
   942static addTesthashs64Fnv1(builder:flatbuffers.Builder, testhashs64Fnv1:bigint) {
   943  builder.addFieldInt64(18, testhashs64Fnv1, BigInt('0'));
   944}
   945
   946static addTesthashu64Fnv1(builder:flatbuffers.Builder, testhashu64Fnv1:bigint) {
   947  builder.addFieldInt64(19, testhashu64Fnv1, BigInt('0'));
   948}
   949
   950static addTesthashs32Fnv1a(builder:flatbuffers.Builder, testhashs32Fnv1a:number) {
   951  builder.addFieldInt32(20, testhashs32Fnv1a, 0);
   952}
   953
   954static addTesthashu32Fnv1a(builder:flatbuffers.Builder, testhashu32Fnv1a:number) {
   955  builder.addFieldInt32(21, testhashu32Fnv1a, 0);
   956}
   957
   958static addTesthashs64Fnv1a(builder:flatbuffers.Builder, testhashs64Fnv1a:bigint) {
   959  builder.addFieldInt64(22, testhashs64Fnv1a, BigInt('0'));
   960}
   961
   962static addTesthashu64Fnv1a(builder:flatbuffers.Builder, testhashu64Fnv1a:bigint) {
   963  builder.addFieldInt64(23, testhashu64Fnv1a, BigInt('0'));
   964}
   965
   966static addTestarrayofbools(builder:flatbuffers.Builder, testarrayofboolsOffset:flatbuffers.Offset) {
   967  builder.addFieldOffset(24, testarrayofboolsOffset, 0);
   968}
   969
   970static createTestarrayofboolsVector(builder:flatbuffers.Builder, data:boolean[]):flatbuffers.Offset {
   971  builder.startVector(1, data.length, 1);
   972  for (let i = data.length - 1; i >= 0; i--) {
   973    builder.addInt8(+data[i]!);
   974  }
   975  return builder.endVector();
   976}
   977
   978static startTestarrayofboolsVector(builder:flatbuffers.Builder, numElems:number) {
   979  builder.startVector(1, numElems, 1);
   980}
   981
   982static addTestf(builder:flatbuffers.Builder, testf:number) {
   983  builder.addFieldFloat32(25, testf, 3.14159);
   984}
   985
   986static addTestf2(builder:flatbuffers.Builder, testf2:number) {
   987  builder.addFieldFloat32(26, testf2, 3.0);
   988}
   989
   990static addTestf3(builder:flatbuffers.Builder, testf3:number) {
   991  builder.addFieldFloat32(27, testf3, 0.0);
   992}
   993
   994static addTestarrayofstring2(builder:flatbuffers.Builder, testarrayofstring2Offset:flatbuffers.Offset) {
   995  builder.addFieldOffset(28, testarrayofstring2Offset, 0);
   996}
   997
   998static createTestarrayofstring2Vector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
   999  builder.startVector(4, data.length, 4);
  1000  for (let i = data.length - 1; i >= 0; i--) {
  1001    builder.addOffset(data[i]!);
  1002  }
  1003  return builder.endVector();
  1004}
  1005
  1006static startTestarrayofstring2Vector(builder:flatbuffers.Builder, numElems:number) {
  1007  builder.startVector(4, numElems, 4);
  1008}
  1009
  1010static addTestarrayofsortedstruct(builder:flatbuffers.Builder, testarrayofsortedstructOffset:flatbuffers.Offset) {
  1011  builder.addFieldOffset(29, testarrayofsortedstructOffset, 0);
  1012}
  1013
  1014static startTestarrayofsortedstructVector(builder:flatbuffers.Builder, numElems:number) {
  1015  builder.startVector(8, numElems, 4);
  1016}
  1017
  1018static addFlex(builder:flatbuffers.Builder, flexOffset:flatbuffers.Offset) {
  1019  builder.addFieldOffset(30, flexOffset, 0);
  1020}
  1021
  1022static createFlexVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset {
  1023  builder.startVector(1, data.length, 1);
  1024  for (let i = data.length - 1; i >= 0; i--) {
  1025    builder.addInt8(data[i]!);
  1026  }
  1027  return builder.endVector();
  1028}
  1029
  1030static startFlexVector(builder:flatbuffers.Builder, numElems:number) {
  1031  builder.startVector(1, numElems, 1);
  1032}
  1033
  1034static addTest5(builder:flatbuffers.Builder, test5Offset:flatbuffers.Offset) {
  1035  builder.addFieldOffset(31, test5Offset, 0);
  1036}
  1037
  1038static startTest5Vector(builder:flatbuffers.Builder, numElems:number) {
  1039  builder.startVector(4, numElems, 2);
  1040}
  1041
  1042static addVectorOfLongs(builder:flatbuffers.Builder, vectorOfLongsOffset:flatbuffers.Offset) {
  1043  builder.addFieldOffset(32, vectorOfLongsOffset, 0);
  1044}
  1045
  1046static createVectorOfLongsVector(builder:flatbuffers.Builder, data:bigint[]):flatbuffers.Offset {
  1047  builder.startVector(8, data.length, 8);
  1048  for (let i = data.length - 1; i >= 0; i--) {
  1049    builder.addInt64(data[i]!);
  1050  }
  1051  return builder.endVector();
  1052}
  1053
  1054static startVectorOfLongsVector(builder:flatbuffers.Builder, numElems:number) {
  1055  builder.startVector(8, numElems, 8);
  1056}
  1057
  1058static addVectorOfDoubles(builder:flatbuffers.Builder, vectorOfDoublesOffset:flatbuffers.Offset) {
  1059  builder.addFieldOffset(33, vectorOfDoublesOffset, 0);
  1060}
  1061
  1062static createVectorOfDoublesVector(builder:flatbuffers.Builder, data:number[]|Float64Array):flatbuffers.Offset;
  1063/**
  1064 * @deprecated This Uint8Array overload will be removed in the future.
  1065 */
  1066static createVectorOfDoublesVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset;
  1067static createVectorOfDoublesVector(builder:flatbuffers.Builder, data:number[]|Float64Array|Uint8Array):flatbuffers.Offset {
  1068  builder.startVector(8, data.length, 8);
  1069  for (let i = data.length - 1; i >= 0; i--) {
  1070    builder.addFloat64(data[i]!);
  1071  }
  1072  return builder.endVector();
  1073}
  1074
  1075static startVectorOfDoublesVector(builder:flatbuffers.Builder, numElems:number) {
  1076  builder.startVector(8, numElems, 8);
  1077}
  1078
  1079static addParentNamespaceTest(builder:flatbuffers.Builder, parentNamespaceTestOffset:flatbuffers.Offset) {
  1080  builder.addFieldOffset(34, parentNamespaceTestOffset, 0);
  1081}
  1082
  1083static addVectorOfReferrables(builder:flatbuffers.Builder, vectorOfReferrablesOffset:flatbuffers.Offset) {
  1084  builder.addFieldOffset(35, vectorOfReferrablesOffset, 0);
  1085}
  1086
  1087static createVectorOfReferrablesVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
  1088  builder.startVector(4, data.length, 4);
  1089  for (let i = data.length - 1; i >= 0; i--) {
  1090    builder.addOffset(data[i]!);
  1091  }
  1092  return builder.endVector();
  1093}
  1094
  1095static startVectorOfReferrablesVector(builder:flatbuffers.Builder, numElems:number) {
  1096  builder.startVector(4, numElems, 4);
  1097}
  1098
  1099static addSingleWeakReference(builder:flatbuffers.Builder, singleWeakReference:bigint) {
  1100  builder.addFieldInt64(36, singleWeakReference, BigInt('0'));
  1101}
  1102
  1103static addVectorOfWeakReferences(builder:flatbuffers.Builder, vectorOfWeakReferencesOffset:flatbuffers.Offset) {
  1104  builder.addFieldOffset(37, vectorOfWeakReferencesOffset, 0);
  1105}
  1106
  1107static createVectorOfWeakReferencesVector(builder:flatbuffers.Builder, data:bigint[]):flatbuffers.Offset {
  1108  builder.startVector(8, data.length, 8);
  1109  for (let i = data.length - 1; i >= 0; i--) {
  1110    builder.addInt64(data[i]!);
  1111  }
  1112  return builder.endVector();
  1113}
  1114
  1115static startVectorOfWeakReferencesVector(builder:flatbuffers.Builder, numElems:number) {
  1116  builder.startVector(8, numElems, 8);
  1117}
  1118
  1119static addVectorOfStrongReferrables(builder:flatbuffers.Builder, vectorOfStrongReferrablesOffset:flatbuffers.Offset) {
  1120  builder.addFieldOffset(38, vectorOfStrongReferrablesOffset, 0);
  1121}
  1122
  1123static createVectorOfStrongReferrablesVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
  1124  builder.startVector(4, data.length, 4);
  1125  for (let i = data.length - 1; i >= 0; i--) {
  1126    builder.addOffset(data[i]!);
  1127  }
  1128  return builder.endVector();
  1129}
  1130
  1131static startVectorOfStrongReferrablesVector(builder:flatbuffers.Builder, numElems:number) {
  1132  builder.startVector(4, numElems, 4);
  1133}
  1134
  1135static addCoOwningReference(builder:flatbuffers.Builder, coOwningReference:bigint) {
  1136  builder.addFieldInt64(39, coOwningReference, BigInt('0'));
  1137}
  1138
  1139static addVectorOfCoOwningReferences(builder:flatbuffers.Builder, vectorOfCoOwningReferencesOffset:flatbuffers.Offset) {
  1140  builder.addFieldOffset(40, vectorOfCoOwningReferencesOffset, 0);
  1141}
  1142
  1143static createVectorOfCoOwningReferencesVector(builder:flatbuffers.Builder, data:bigint[]):flatbuffers.Offset {
  1144  builder.startVector(8, data.length, 8);
  1145  for (let i = data.length - 1; i >= 0; i--) {
  1146    builder.addInt64(data[i]!);
  1147  }
  1148  return builder.endVector();
  1149}
  1150
  1151static startVectorOfCoOwningReferencesVector(builder:flatbuffers.Builder, numElems:number) {
  1152  builder.startVector(8, numElems, 8);
  1153}
  1154
  1155static addNonOwningReference(builder:flatbuffers.Builder, nonOwningReference:bigint) {
  1156  builder.addFieldInt64(41, nonOwningReference, BigInt('0'));
  1157}
  1158
  1159static addVectorOfNonOwningReferences(builder:flatbuffers.Builder, vectorOfNonOwningReferencesOffset:flatbuffers.Offset) {
  1160  builder.addFieldOffset(42, vectorOfNonOwningReferencesOffset, 0);
  1161}
  1162
  1163static createVectorOfNonOwningReferencesVector(builder:flatbuffers.Builder, data:bigint[]):flatbuffers.Offset {
  1164  builder.startVector(8, data.length, 8);
  1165  for (let i = data.length - 1; i >= 0; i--) {
  1166    builder.addInt64(data[i]!);
  1167  }
  1168  return builder.endVector();
  1169}
  1170
  1171static startVectorOfNonOwningReferencesVector(builder:flatbuffers.Builder, numElems:number) {
  1172  builder.startVector(8, numElems, 8);
  1173}
  1174
  1175static addAnyUniqueType(builder:flatbuffers.Builder, anyUniqueType:AnyUniqueAliases) {
  1176  builder.addFieldInt8(43, anyUniqueType, AnyUniqueAliases.NONE);
  1177}
  1178
  1179static addAnyUnique(builder:flatbuffers.Builder, anyUniqueOffset:flatbuffers.Offset) {
  1180  builder.addFieldOffset(44, anyUniqueOffset, 0);
  1181}
  1182
  1183static addAnyAmbiguousType(builder:flatbuffers.Builder, anyAmbiguousType:AnyAmbiguousAliases) {
  1184  builder.addFieldInt8(45, anyAmbiguousType, AnyAmbiguousAliases.NONE);
  1185}
  1186
  1187static addAnyAmbiguous(builder:flatbuffers.Builder, anyAmbiguousOffset:flatbuffers.Offset) {
  1188  builder.addFieldOffset(46, anyAmbiguousOffset, 0);
  1189}
  1190
  1191static addVectorOfEnums(builder:flatbuffers.Builder, vectorOfEnumsOffset:flatbuffers.Offset) {
  1192  builder.addFieldOffset(47, vectorOfEnumsOffset, 0);
  1193}
  1194
  1195static createVectorOfEnumsVector(builder:flatbuffers.Builder, data:Color[]):flatbuffers.Offset {
  1196  builder.startVector(1, data.length, 1);
  1197  for (let i = data.length - 1; i >= 0; i--) {
  1198    builder.addInt8(data[i]!);
  1199  }
  1200  return builder.endVector();
  1201}
  1202
  1203static startVectorOfEnumsVector(builder:flatbuffers.Builder, numElems:number) {
  1204  builder.startVector(1, numElems, 1);
  1205}
  1206
  1207static addSignedEnum(builder:flatbuffers.Builder, signedEnum:Race) {
  1208  builder.addFieldInt8(48, signedEnum, Race.None);
  1209}
  1210
  1211static addTestrequirednestedflatbuffer(builder:flatbuffers.Builder, testrequirednestedflatbufferOffset:flatbuffers.Offset) {
  1212  builder.addFieldOffset(49, testrequirednestedflatbufferOffset, 0);
  1213}
  1214
  1215static createTestrequirednestedflatbufferVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset {
  1216  builder.startVector(1, data.length, 1);
  1217  for (let i = data.length - 1; i >= 0; i--) {
  1218    builder.addInt8(data[i]!);
  1219  }
  1220  return builder.endVector();
  1221}
  1222
  1223static startTestrequirednestedflatbufferVector(builder:flatbuffers.Builder, numElems:number) {
  1224  builder.startVector(1, numElems, 1);
  1225}
  1226
  1227static addScalarKeySortedTables(builder:flatbuffers.Builder, scalarKeySortedTablesOffset:flatbuffers.Offset) {
  1228  builder.addFieldOffset(50, scalarKeySortedTablesOffset, 0);
  1229}
  1230
  1231static createScalarKeySortedTablesVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
  1232  builder.startVector(4, data.length, 4);
  1233  for (let i = data.length - 1; i >= 0; i--) {
  1234    builder.addOffset(data[i]!);
  1235  }
  1236  return builder.endVector();
  1237}
  1238
  1239static startScalarKeySortedTablesVector(builder:flatbuffers.Builder, numElems:number) {
  1240  builder.startVector(4, numElems, 4);
  1241}
  1242
  1243static addNativeInline(builder:flatbuffers.Builder, nativeInlineOffset:flatbuffers.Offset) {
  1244  builder.addFieldStruct(51, nativeInlineOffset, 0);
  1245}
  1246
  1247static addLongEnumNonEnumDefault(builder:flatbuffers.Builder, longEnumNonEnumDefault:bigint) {
  1248  builder.addFieldInt64(52, longEnumNonEnumDefault, BigInt('0'));
  1249}
  1250
  1251static addLongEnumNormalDefault(builder:flatbuffers.Builder, longEnumNormalDefault:bigint) {
  1252  builder.addFieldInt64(53, longEnumNormalDefault, BigInt('2'));
  1253}
  1254
  1255static addNanDefault(builder:flatbuffers.Builder, nanDefault:number) {
  1256  builder.addFieldFloat32(54, nanDefault, NaN);
  1257}
  1258
  1259static addInfDefault(builder:flatbuffers.Builder, infDefault:number) {
  1260  builder.addFieldFloat32(55, infDefault, Infinity);
  1261}
  1262
  1263static addPositiveInfDefault(builder:flatbuffers.Builder, positiveInfDefault:number) {
  1264  builder.addFieldFloat32(56, positiveInfDefault, Infinity);
  1265}
  1266
  1267static addInfinityDefault(builder:flatbuffers.Builder, infinityDefault:number) {
  1268  builder.addFieldFloat32(57, infinityDefault, Infinity);
  1269}
  1270
  1271static addPositiveInfinityDefault(builder:flatbuffers.Builder, positiveInfinityDefault:number) {
  1272  builder.addFieldFloat32(58, positiveInfinityDefault, Infinity);
  1273}
  1274
  1275static addNegativeInfDefault(builder:flatbuffers.Builder, negativeInfDefault:number) {
  1276  builder.addFieldFloat32(59, negativeInfDefault, -Infinity);
  1277}
  1278
  1279static addNegativeInfinityDefault(builder:flatbuffers.Builder, negativeInfinityDefault:number) {
  1280  builder.addFieldFloat32(60, negativeInfinityDefault, -Infinity);
  1281}
  1282
  1283static addDoubleInfDefault(builder:flatbuffers.Builder, doubleInfDefault:number) {
  1284  builder.addFieldFloat64(61, doubleInfDefault, Infinity);
  1285}
  1286
  1287static endMonster(builder:flatbuffers.Builder):flatbuffers.Offset {
  1288  const offset = builder.endObject();
  1289  builder.requiredField(offset, 10) // name
  1290  return offset;
  1291}
  1292
  1293static finishMonsterBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) {
  1294  builder.finish(offset, 'MONS');
  1295}
  1296
  1297static finishSizePrefixedMonsterBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) {
  1298  builder.finish(offset, 'MONS', true);
  1299}
  1300
  1301
  1302serialize():Uint8Array {
  1303  return this.bb!.bytes();
  1304}
  1305
  1306static deserialize(buffer: Uint8Array):Monster {
  1307  return Monster.getRootAsMonster(new flatbuffers.ByteBuffer(buffer))
  1308}
  1309
  1310unpack(): MonsterT {
  1311  return new MonsterT(
  1312    (this.pos() !== null ? this.pos()!.unpack() : null),
  1313    this.mana(),
  1314    this.hp(),
  1315    this.name(),
  1316    this.bb!.createScalarList<number>(this.inventory.bind(this), this.inventoryLength()),
  1317    this.color(),
  1318    this.testType(),
  1319    (() => {
  1320      const temp = unionToAny(this.testType(), this.test.bind(this));
  1321      if(temp === null) { return null; }
  1322      return temp.unpack()
  1323  })(),
  1324    this.bb!.createObjList<Test, TestT>(this.test4.bind(this), this.test4Length()),
  1325    this.bb!.createScalarList<string>(this.testarrayofstring.bind(this), this.testarrayofstringLength()),
  1326    this.bb!.createObjList<Monster, MonsterT>(this.testarrayoftables.bind(this), this.testarrayoftablesLength()),
  1327    (this.enemy() !== null ? this.enemy()!.unpack() : null),
  1328    this.bb!.createScalarList<number>(this.testnestedflatbuffer.bind(this), this.testnestedflatbufferLength()),
  1329    (this.testempty() !== null ? this.testempty()!.unpack() : null),
  1330    this.testbool(),
  1331    this.testhashs32Fnv1(),
  1332    this.testhashu32Fnv1(),
  1333    this.testhashs64Fnv1(),
  1334    this.testhashu64Fnv1(),
  1335    this.testhashs32Fnv1a(),
  1336    this.testhashu32Fnv1a(),
  1337    this.testhashs64Fnv1a(),
  1338    this.testhashu64Fnv1a(),
  1339    this.bb!.createScalarList<boolean>(this.testarrayofbools.bind(this), this.testarrayofboolsLength()),
  1340    this.testf(),
  1341    this.testf2(),
  1342    this.testf3(),
  1343    this.bb!.createScalarList<string>(this.testarrayofstring2.bind(this), this.testarrayofstring2Length()),
  1344    this.bb!.createObjList<Ability, AbilityT>(this.testarrayofsortedstruct.bind(this), this.testarrayofsortedstructLength()),
  1345    this.bb!.createScalarList<number>(this.flex.bind(this), this.flexLength()),
  1346    this.bb!.createObjList<Test, TestT>(this.test5.bind(this), this.test5Length()),
  1347    this.bb!.createScalarList<bigint>(this.vectorOfLongs.bind(this), this.vectorOfLongsLength()),
  1348    this.bb!.createScalarList<number>(this.vectorOfDoubles.bind(this), this.vectorOfDoublesLength()),
  1349    (this.parentNamespaceTest() !== null ? this.parentNamespaceTest()!.unpack() : null),
  1350    this.bb!.createObjList<Referrable, ReferrableT>(this.vectorOfReferrables.bind(this), this.vectorOfReferrablesLength()),
  1351    this.singleWeakReference(),
  1352    this.bb!.createScalarList<bigint>(this.vectorOfWeakReferences.bind(this), this.vectorOfWeakReferencesLength()),
  1353    this.bb!.createObjList<Referrable, ReferrableT>(this.vectorOfStrongReferrables.bind(this), this.vectorOfStrongReferrablesLength()),
  1354    this.coOwningReference(),
  1355    this.bb!.createScalarList<bigint>(this.vectorOfCoOwningReferences.bind(this), this.vectorOfCoOwningReferencesLength()),
  1356    this.nonOwningReference(),
  1357    this.bb!.createScalarList<bigint>(this.vectorOfNonOwningReferences.bind(this), this.vectorOfNonOwningReferencesLength()),
  1358    this.anyUniqueType(),
  1359    (() => {
  1360      const temp = unionToAnyUniqueAliases(this.anyUniqueType(), this.anyUnique.bind(this));
  1361      if(temp === null) { return null; }
  1362      return temp.unpack()
  1363  })(),
  1364    this.anyAmbiguousType(),
  1365    (() => {
  1366      const temp = unionToAnyAmbiguousAliases(this.anyAmbiguousType(), this.anyAmbiguous.bind(this));
  1367      if(temp === null) { return null; }
  1368      return temp.unpack()
  1369  })(),
  1370    this.bb!.createScalarList<Color>(this.vectorOfEnums.bind(this), this.vectorOfEnumsLength()),
  1371    this.signedEnum(),
  1372    this.bb!.createScalarList<number>(this.testrequirednestedflatbuffer.bind(this), this.testrequirednestedflatbufferLength()),
  1373    this.bb!.createObjList<Stat, StatT>(this.scalarKeySortedTables.bind(this), this.scalarKeySortedTablesLength()),
  1374    (this.nativeInline() !== null ? this.nativeInline()!.unpack() : null),
  1375    this.longEnumNonEnumDefault(),
  1376    this.longEnumNormalDefault(),
  1377    this.nanDefault(),
  1378    this.infDefault(),
  1379    this.positiveInfDefault(),
  1380    this.infinityDefault(),
  1381    this.positiveInfinityDefault(),
  1382    this.negativeInfDefault(),
  1383    this.negativeInfinityDefault(),
  1384    this.doubleInfDefault()
  1385  );
  1386}
  1387
  1388
  1389unpackTo(_o: MonsterT): void {
  1390  _o.pos = (this.pos() !== null ? this.pos()!.unpack() : null);
  1391  _o.mana = this.mana();
  1392  _o.hp = this.hp();
  1393  _o.name = this.name();
  1394  _o.inventory = this.bb!.createScalarList<number>(this.inventory.bind(this), this.inventoryLength());
  1395  _o.color = this.color();
  1396  _o.testType = this.testType();
  1397  _o.test = (() => {
  1398      const temp = unionToAny(this.testType(), this.test.bind(this));
  1399      if(temp === null) { return null; }
  1400      return temp.unpack()
  1401  })();
  1402  _o.test4 = this.bb!.createObjList<Test, TestT>(this.test4.bind(this), this.test4Length());
  1403  _o.testarrayofstring = this.bb!.createScalarList<string>(this.testarrayofstring.bind(this), this.testarrayofstringLength());
  1404  _o.testarrayoftables = this.bb!.createObjList<Monster, MonsterT>(this.testarrayoftables.bind(this), this.testarrayoftablesLength());
  1405  _o.enemy = (this.enemy() !== null ? this.enemy()!.unpack() : null);
  1406  _o.testnestedflatbuffer = this.bb!.createScalarList<number>(this.testnestedflatbuffer.bind(this), this.testnestedflatbufferLength());
  1407  _o.testempty = (this.testempty() !== null ? this.testempty()!.unpack() : null);
  1408  _o.testbool = this.testbool();
  1409  _o.testhashs32Fnv1 = this.testhashs32Fnv1();
  1410  _o.testhashu32Fnv1 = this.testhashu32Fnv1();
  1411  _o.testhashs64Fnv1 = this.testhashs64Fnv1();
  1412  _o.testhashu64Fnv1 = this.testhashu64Fnv1();
  1413  _o.testhashs32Fnv1a = this.testhashs32Fnv1a();
  1414  _o.testhashu32Fnv1a = this.testhashu32Fnv1a();
  1415  _o.testhashs64Fnv1a = this.testhashs64Fnv1a();
  1416  _o.testhashu64Fnv1a = this.testhashu64Fnv1a();
  1417  _o.testarrayofbools = this.bb!.createScalarList<boolean>(this.testarrayofbools.bind(this), this.testarrayofboolsLength());
  1418  _o.testf = this.testf();
  1419  _o.testf2 = this.testf2();
  1420  _o.testf3 = this.testf3();
  1421  _o.testarrayofstring2 = this.bb!.createScalarList<string>(this.testarrayofstring2.bind(this), this.testarrayofstring2Length());
  1422  _o.testarrayofsortedstruct = this.bb!.createObjList<Ability, AbilityT>(this.testarrayofsortedstruct.bind(this), this.testarrayofsortedstructLength());
  1423  _o.flex = this.bb!.createScalarList<number>(this.flex.bind(this), this.flexLength());
  1424  _o.test5 = this.bb!.createObjList<Test, TestT>(this.test5.bind(this), this.test5Length());
  1425  _o.vectorOfLongs = this.bb!.createScalarList<bigint>(this.vectorOfLongs.bind(this), this.vectorOfLongsLength());
  1426  _o.vectorOfDoubles = this.bb!.createScalarList<number>(this.vectorOfDoubles.bind(this), this.vectorOfDoublesLength());
  1427  _o.parentNamespaceTest = (this.parentNamespaceTest() !== null ? this.parentNamespaceTest()!.unpack() : null);
  1428  _o.vectorOfReferrables = this.bb!.createObjList<Referrable, ReferrableT>(this.vectorOfReferrables.bind(this), this.vectorOfReferrablesLength());
  1429  _o.singleWeakReference = this.singleWeakReference();
  1430  _o.vectorOfWeakReferences = this.bb!.createScalarList<bigint>(this.vectorOfWeakReferences.bind(this), this.vectorOfWeakReferencesLength());
  1431  _o.vectorOfStrongReferrables = this.bb!.createObjList<Referrable, ReferrableT>(this.vectorOfStrongReferrables.bind(this), this.vectorOfStrongReferrablesLength());
  1432  _o.coOwningReference = this.coOwningReference();
  1433  _o.vectorOfCoOwningReferences = this.bb!.createScalarList<bigint>(this.vectorOfCoOwningReferences.bind(this), this.vectorOfCoOwningReferencesLength());
  1434  _o.nonOwningReference = this.nonOwningReference();
  1435  _o.vectorOfNonOwningReferences = this.bb!.createScalarList<bigint>(this.vectorOfNonOwningReferences.bind(this), this.vectorOfNonOwningReferencesLength());
  1436  _o.anyUniqueType = this.anyUniqueType();
  1437  _o.anyUnique = (() => {
  1438      const temp = unionToAnyUniqueAliases(this.anyUniqueType(), this.anyUnique.bind(this));
  1439      if(temp === null) { return null; }
  1440      return temp.unpack()
  1441  })();
  1442  _o.anyAmbiguousType = this.anyAmbiguousType();
  1443  _o.anyAmbiguous = (() => {
  1444      const temp = unionToAnyAmbiguousAliases(this.anyAmbiguousType(), this.anyAmbiguous.bind(this));
  1445      if(temp === null) { return null; }
  1446      return temp.unpack()
  1447  })();
  1448  _o.vectorOfEnums = this.bb!.createScalarList<Color>(this.vectorOfEnums.bind(this), this.vectorOfEnumsLength());
  1449  _o.signedEnum = this.signedEnum();
  1450  _o.testrequirednestedflatbuffer = this.bb!.createScalarList<number>(this.testrequirednestedflatbuffer.bind(this), this.testrequirednestedflatbufferLength());
  1451  _o.scalarKeySortedTables = this.bb!.createObjList<Stat, StatT>(this.scalarKeySortedTables.bind(this), this.scalarKeySortedTablesLength());
  1452  _o.nativeInline = (this.nativeInline() !== null ? this.nativeInline()!.unpack() : null);
  1453  _o.longEnumNonEnumDefault = this.longEnumNonEnumDefault();
  1454  _o.longEnumNormalDefault = this.longEnumNormalDefault();
  1455  _o.nanDefault = this.nanDefault();
  1456  _o.infDefault = this.infDefault();
  1457  _o.positiveInfDefault = this.positiveInfDefault();
  1458  _o.infinityDefault = this.infinityDefault();
  1459  _o.positiveInfinityDefault = this.positiveInfinityDefault();
  1460  _o.negativeInfDefault = this.negativeInfDefault();
  1461  _o.negativeInfinityDefault = this.negativeInfinityDefault();
  1462  _o.doubleInfDefault = this.doubleInfDefault();
  1463}
  1464}
  1465
  1466export class MonsterT implements flatbuffers.IGeneratedObject {
  1467constructor(
  1468  public pos: Vec3T|null = null,
  1469  public mana: number = 150,
  1470  public hp: number = 100,
  1471  public name: string|Uint8Array|null = null,
  1472  public inventory: (number)[] = [],
  1473  public color: Color = Color.Blue,
  1474  public testType: Any = Any.NONE,
  1475  public test: MonsterT|MyGame_Example2_MonsterT|TestSimpleTableWithEnumT|null = null,
  1476  public test4: (TestT)[] = [],
  1477  public testarrayofstring: (string)[] = [],
  1478  public testarrayoftables: (MonsterT)[] = [],
  1479  public enemy: MonsterT|null = null,
  1480  public testnestedflatbuffer: (number)[] = [],
  1481  public testempty: StatT|null = null,
  1482  public testbool: boolean = false,
  1483  public testhashs32Fnv1: number = 0,
  1484  public testhashu32Fnv1: number = 0,
  1485  public testhashs64Fnv1: bigint = BigInt('0'),
  1486  public testhashu64Fnv1: bigint = BigInt('0'),
  1487  public testhashs32Fnv1a: number = 0,
  1488  public testhashu32Fnv1a: number = 0,
  1489  public testhashs64Fnv1a: bigint = BigInt('0'),
  1490  public testhashu64Fnv1a: bigint = BigInt('0'),
  1491  public testarrayofbools: (boolean)[] = [],
  1492  public testf: number = 3.14159,
  1493  public testf2: number = 3.0,
  1494  public testf3: number = 0.0,
  1495  public testarrayofstring2: (string)[] = [],
  1496  public testarrayofsortedstruct: (AbilityT)[] = [],
  1497  public flex: (number)[] = [],
  1498  public test5: (TestT)[] = [],
  1499  public vectorOfLongs: (bigint)[] = [],
  1500  public vectorOfDoubles: (number)[] = [],
  1501  public parentNamespaceTest: InParentNamespaceT|null = null,
  1502  public vectorOfReferrables: (ReferrableT)[] = [],
  1503  public singleWeakReference: bigint = BigInt('0'),
  1504  public vectorOfWeakReferences: (bigint)[] = [],
  1505  public vectorOfStrongReferrables: (ReferrableT)[] = [],
  1506  public coOwningReference: bigint = BigInt('0'),
  1507  public vectorOfCoOwningReferences: (bigint)[] = [],
  1508  public nonOwningReference: bigint = BigInt('0'),
  1509  public vectorOfNonOwningReferences: (bigint)[] = [],
  1510  public anyUniqueType: AnyUniqueAliases = AnyUniqueAliases.NONE,
  1511  public anyUnique: MonsterT|MyGame_Example2_MonsterT|TestSimpleTableWithEnumT|null = null,
  1512  public anyAmbiguousType: AnyAmbiguousAliases = AnyAmbiguousAliases.NONE,
  1513  public anyAmbiguous: MonsterT|null = null,
  1514  public vectorOfEnums: (Color)[] = [],
  1515  public signedEnum: Race = Race.None,
  1516  public testrequirednestedflatbuffer: (number)[] = [],
  1517  public scalarKeySortedTables: (StatT)[] = [],
  1518  public nativeInline: TestT|null = null,
  1519  public longEnumNonEnumDefault: bigint = BigInt('0'),
  1520  public longEnumNormalDefault: bigint = BigInt('2'),
  1521  public nanDefault: number = NaN,
  1522  public infDefault: number = Infinity,
  1523  public positiveInfDefault: number = Infinity,
  1524  public infinityDefault: number = Infinity,
  1525  public positiveInfinityDefault: number = Infinity,
  1526  public negativeInfDefault: number = -Infinity,
  1527  public negativeInfinityDefault: number = -Infinity,
  1528  public doubleInfDefault: number = Infinity
  1529){}
  1530
  1531
  1532pack(builder:flatbuffers.Builder): flatbuffers.Offset {
  1533  const name = (this.name !== null ? builder.createString(this.name!) : 0);
  1534  const inventory = Monster.createInventoryVector(builder, this.inventory);
  1535  const test = builder.createObjectOffset(this.test);
  1536  const test4 = builder.createStructOffsetList(this.test4, Monster.startTest4Vector);
  1537  const testarrayofstring = Monster.createTestarrayofstringVector(builder, builder.createObjectOffsetList(this.testarrayofstring));
  1538  const testarrayoftables = Monster.createTestarrayoftablesVector(builder, builder.createObjectOffsetList(this.testarrayoftables));
  1539  const enemy = (this.enemy !== null ? this.enemy!.pack(builder) : 0);
  1540  const testnestedflatbuffer = Monster.createTestnestedflatbufferVector(builder, this.testnestedflatbuffer);
  1541  const testempty = (this.testempty !== null ? this.testempty!.pack(builder) : 0);
  1542  const testarrayofbools = Monster.createTestarrayofboolsVector(builder, this.testarrayofbools);
  1543  const testarrayofstring2 = Monster.createTestarrayofstring2Vector(builder, builder.createObjectOffsetList(this.testarrayofstring2));
  1544  const testarrayofsortedstruct = builder.createStructOffsetList(this.testarrayofsortedstruct, Monster.startTestarrayofsortedstructVector);
  1545  const flex = Monster.createFlexVector(builder, this.flex);
  1546  const test5 = builder.createStructOffsetList(this.test5, Monster.startTest5Vector);
  1547  const vectorOfLongs = Monster.createVectorOfLongsVector(builder, this.vectorOfLongs);
  1548  const vectorOfDoubles = Monster.createVectorOfDoublesVector(builder, this.vectorOfDoubles);
  1549  const parentNamespaceTest = (this.parentNamespaceTest !== null ? this.parentNamespaceTest!.pack(builder) : 0);
  1550  const vectorOfReferrables = Monster.createVectorOfReferrablesVector(builder, builder.createObjectOffsetList(this.vectorOfReferrables));
  1551  const vectorOfWeakReferences = Monster.createVectorOfWeakReferencesVector(builder, this.vectorOfWeakReferences);
  1552  const vectorOfStrongReferrables = Monster.createVectorOfStrongReferrablesVector(builder, builder.createObjectOffsetList(this.vectorOfStrongReferrables));
  1553  const vectorOfCoOwningReferences = Monster.createVectorOfCoOwningReferencesVector(builder, this.vectorOfCoOwningReferences);
  1554  const vectorOfNonOwningReferences = Monster.createVectorOfNonOwningReferencesVector(builder, this.vectorOfNonOwningReferences);
  1555  const anyUnique = builder.createObjectOffset(this.anyUnique);
  1556  const anyAmbiguous = builder.createObjectOffset(this.anyAmbiguous);
  1557  const vectorOfEnums = Monster.createVectorOfEnumsVector(builder, this.vectorOfEnums);
  1558  const testrequirednestedflatbuffer = Monster.createTestrequirednestedflatbufferVector(builder, this.testrequirednestedflatbuffer);
  1559  const scalarKeySortedTables = Monster.createScalarKeySortedTablesVector(builder, builder.createObjectOffsetList(this.scalarKeySortedTables));
  1560
  1561  Monster.startMonster(builder);
  1562  Monster.addPos(builder, (this.pos !== null ? this.pos!.pack(builder) : 0));
  1563  Monster.addMana(builder, this.mana);
  1564  Monster.addHp(builder, this.hp);
  1565  Monster.addName(builder, name);
  1566  Monster.addInventory(builder, inventory);
  1567  Monster.addColor(builder, this.color);
  1568  Monster.addTestType(builder, this.testType);
  1569  Monster.addTest(builder, test);
  1570  Monster.addTest4(builder, test4);
  1571  Monster.addTestarrayofstring(builder, testarrayofstring);
  1572  Monster.addTestarrayoftables(builder, testarrayoftables);
  1573  Monster.addEnemy(builder, enemy);
  1574  Monster.addTestnestedflatbuffer(builder, testnestedflatbuffer);
  1575  Monster.addTestempty(builder, testempty);
  1576  Monster.addTestbool(builder, this.testbool);
  1577  Monster.addTesthashs32Fnv1(builder, this.testhashs32Fnv1);
  1578  Monster.addTesthashu32Fnv1(builder, this.testhashu32Fnv1);
  1579  Monster.addTesthashs64Fnv1(builder, this.testhashs64Fnv1);
  1580  Monster.addTesthashu64Fnv1(builder, this.testhashu64Fnv1);
  1581  Monster.addTesthashs32Fnv1a(builder, this.testhashs32Fnv1a);
  1582  Monster.addTesthashu32Fnv1a(builder, this.testhashu32Fnv1a);
  1583  Monster.addTesthashs64Fnv1a(builder, this.testhashs64Fnv1a);
  1584  Monster.addTesthashu64Fnv1a(builder, this.testhashu64Fnv1a);
  1585  Monster.addTestarrayofbools(builder, testarrayofbools);
  1586  Monster.addTestf(builder, this.testf);
  1587  Monster.addTestf2(builder, this.testf2);
  1588  Monster.addTestf3(builder, this.testf3);
  1589  Monster.addTestarrayofstring2(builder, testarrayofstring2);
  1590  Monster.addTestarrayofsortedstruct(builder, testarrayofsortedstruct);
  1591  Monster.addFlex(builder, flex);
  1592  Monster.addTest5(builder, test5);
  1593  Monster.addVectorOfLongs(builder, vectorOfLongs);
  1594  Monster.addVectorOfDoubles(builder, vectorOfDoubles);
  1595  Monster.addParentNamespaceTest(builder, parentNamespaceTest);
  1596  Monster.addVectorOfReferrables(builder, vectorOfReferrables);
  1597  Monster.addSingleWeakReference(builder, this.singleWeakReference);
  1598  Monster.addVectorOfWeakReferences(builder, vectorOfWeakReferences);
  1599  Monster.addVectorOfStrongReferrables(builder, vectorOfStrongReferrables);
  1600  Monster.addCoOwningReference(builder, this.coOwningReference);
  1601  Monster.addVectorOfCoOwningReferences(builder, vectorOfCoOwningReferences);
  1602  Monster.addNonOwningReference(builder, this.nonOwningReference);
  1603  Monster.addVectorOfNonOwningReferences(builder, vectorOfNonOwningReferences);
  1604  Monster.addAnyUniqueType(builder, this.anyUniqueType);
  1605  Monster.addAnyUnique(builder, anyUnique);
  1606  Monster.addAnyAmbiguousType(builder, this.anyAmbiguousType);
  1607  Monster.addAnyAmbiguous(builder, anyAmbiguous);
  1608  Monster.addVectorOfEnums(builder, vectorOfEnums);
  1609  Monster.addSignedEnum(builder, this.signedEnum);
  1610  Monster.addTestrequirednestedflatbuffer(builder, testrequirednestedflatbuffer);
  1611  Monster.addScalarKeySortedTables(builder, scalarKeySortedTables);
  1612  Monster.addNativeInline(builder, (this.nativeInline !== null ? this.nativeInline!.pack(builder) : 0));
  1613  Monster.addLongEnumNonEnumDefault(builder, this.longEnumNonEnumDefault);
  1614  Monster.addLongEnumNormalDefault(builder, this.longEnumNormalDefault);
  1615  Monster.addNanDefault(builder, this.nanDefault);
  1616  Monster.addInfDefault(builder, this.infDefault);
  1617  Monster.addPositiveInfDefault(builder, this.positiveInfDefault);
  1618  Monster.addInfinityDefault(builder, this.infinityDefault);
  1619  Monster.addPositiveInfinityDefault(builder, this.positiveInfinityDefault);
  1620  Monster.addNegativeInfDefault(builder, this.negativeInfDefault);
  1621  Monster.addNegativeInfinityDefault(builder, this.negativeInfinityDefault);
  1622  Monster.addDoubleInfDefault(builder, this.doubleInfDefault);
  1623
  1624  return Monster.endMonster(builder);
  1625}
  1626}

View as plain text