// automatically generated by the FlatBuffers compiler, do not modify

import * as flatbuffers from 'flatbuffers';

export enum MyGame_OtherNameSpace_FromInclude {
  IncludeVal = '0'
}

/**
 * Composite components of Monster color.
 */
export enum MyGame_Example_Color {
  Red = 1,

  /**
   * \brief color Green
   * Green is bit_flag with value (1u << 1)
   */
  Green = 2,

  /**
   * \brief color Blue (1u << 3)
   */
  Blue = 8
}

export enum MyGame_Example_Race {
  None = -1,
  Human = 0,
  Dwarf = 1,
  Elf = 2
}

export enum MyGame_Example_LongEnum {
  LongOne = '2',
  LongTwo = '4',
  LongBig = '1099511627776'
}

export enum MyGame_Example_Any {
  NONE = 0,
  Monster = 1,
  TestSimpleTableWithEnum = 2,
  MyGame_Example2_Monster = 3
}

export function unionToAny(
  type: MyGame_Example_Any,
  accessor: (obj:MyGame_Example2_Monster|MyGame_Example_Monster|MyGame_Example_TestSimpleTableWithEnum) => MyGame_Example2_Monster|MyGame_Example_Monster|MyGame_Example_TestSimpleTableWithEnum|null
): MyGame_Example2_Monster|MyGame_Example_Monster|MyGame_Example_TestSimpleTableWithEnum|null {
  switch(MyGame_Example_Any[type]) {
    case 'NONE': return null; 
    case 'Monster': return accessor(new MyGame_Example_Monster())! as MyGame_Example_Monster;
    case 'TestSimpleTableWithEnum': return accessor(new MyGame_Example_TestSimpleTableWithEnum())! as MyGame_Example_TestSimpleTableWithEnum;
    case 'MyGame_Example2_Monster': return accessor(new MyGame_Example2_Monster())! as MyGame_Example2_Monster;
    default: return null;
  }
}

export function unionListToAny(
  type: MyGame_Example_Any, 
  accessor: (index: number, obj:MyGame_Example2_Monster|MyGame_Example_Monster|MyGame_Example_TestSimpleTableWithEnum) => MyGame_Example2_Monster|MyGame_Example_Monster|MyGame_Example_TestSimpleTableWithEnum|null, 
  index: number
): MyGame_Example2_Monster|MyGame_Example_Monster|MyGame_Example_TestSimpleTableWithEnum|null {
  switch(MyGame_Example_Any[type]) {
    case 'NONE': return null; 
    case 'Monster': return accessor(index, new MyGame_Example_Monster())! as MyGame_Example_Monster;
    case 'TestSimpleTableWithEnum': return accessor(index, new MyGame_Example_TestSimpleTableWithEnum())! as MyGame_Example_TestSimpleTableWithEnum;
    case 'MyGame_Example2_Monster': return accessor(index, new MyGame_Example2_Monster())! as MyGame_Example2_Monster;
    default: return null;
  }
}

export enum MyGame_Example_AnyUniqueAliases {
  NONE = 0,
  M = 1,
  TS = 2,
  M2 = 3
}

export function unionToAnyUniqueAliases(
  type: MyGame_Example_AnyUniqueAliases,
  accessor: (obj:MyGame_Example2_Monster|MyGame_Example_Monster|MyGame_Example_TestSimpleTableWithEnum) => MyGame_Example2_Monster|MyGame_Example_Monster|MyGame_Example_TestSimpleTableWithEnum|null
): MyGame_Example2_Monster|MyGame_Example_Monster|MyGame_Example_TestSimpleTableWithEnum|null {
  switch(MyGame_Example_AnyUniqueAliases[type]) {
    case 'NONE': return null; 
    case 'M': return accessor(new MyGame_Example_Monster())! as MyGame_Example_Monster;
    case 'TS': return accessor(new MyGame_Example_TestSimpleTableWithEnum())! as MyGame_Example_TestSimpleTableWithEnum;
    case 'M2': return accessor(new MyGame_Example2_Monster())! as MyGame_Example2_Monster;
    default: return null;
  }
}

export function unionListToAnyUniqueAliases(
  type: MyGame_Example_AnyUniqueAliases, 
  accessor: (index: number, obj:MyGame_Example2_Monster|MyGame_Example_Monster|MyGame_Example_TestSimpleTableWithEnum) => MyGame_Example2_Monster|MyGame_Example_Monster|MyGame_Example_TestSimpleTableWithEnum|null, 
  index: number
): MyGame_Example2_Monster|MyGame_Example_Monster|MyGame_Example_TestSimpleTableWithEnum|null {
  switch(MyGame_Example_AnyUniqueAliases[type]) {
    case 'NONE': return null; 
    case 'M': return accessor(index, new MyGame_Example_Monster())! as MyGame_Example_Monster;
    case 'TS': return accessor(index, new MyGame_Example_TestSimpleTableWithEnum())! as MyGame_Example_TestSimpleTableWithEnum;
    case 'M2': return accessor(index, new MyGame_Example2_Monster())! as MyGame_Example2_Monster;
    default: return null;
  }
}

export enum MyGame_Example_AnyAmbiguousAliases {
  NONE = 0,
  M1 = 1,
  M2 = 2,
  M3 = 3
}

export function unionToAnyAmbiguousAliases(
  type: MyGame_Example_AnyAmbiguousAliases,
  accessor: (obj:MyGame_Example_Monster) => MyGame_Example_Monster|null
): MyGame_Example_Monster|null {
  switch(MyGame_Example_AnyAmbiguousAliases[type]) {
    case 'NONE': return null; 
    case 'M1': return accessor(new MyGame_Example_Monster())! as MyGame_Example_Monster;
    case 'M2': return accessor(new MyGame_Example_Monster())! as MyGame_Example_Monster;
    case 'M3': return accessor(new MyGame_Example_Monster())! as MyGame_Example_Monster;
    default: return null;
  }
}

export function unionListToAnyAmbiguousAliases(
  type: MyGame_Example_AnyAmbiguousAliases, 
  accessor: (index: number, obj:MyGame_Example_Monster) => MyGame_Example_Monster|null, 
  index: number
): MyGame_Example_Monster|null {
  switch(MyGame_Example_AnyAmbiguousAliases[type]) {
    case 'NONE': return null; 
    case 'M1': return accessor(index, new MyGame_Example_Monster())! as MyGame_Example_Monster;
    case 'M2': return accessor(index, new MyGame_Example_Monster())! as MyGame_Example_Monster;
    case 'M3': return accessor(index, new MyGame_Example_Monster())! as MyGame_Example_Monster;
    default: return null;
  }
}

export class MyGame_OtherNameSpace_Unused {
  bb: flatbuffers.ByteBuffer|null = null;
  bb_pos = 0;
  __init(i:number, bb:flatbuffers.ByteBuffer):MyGame_OtherNameSpace_Unused {
  this.bb_pos = i;
  this.bb = bb;
  return this;
}

a():number {
  return this.bb!.readInt32(this.bb_pos);
}

static sizeOf():number {
  return 4;
}

static createUnused(builder:flatbuffers.Builder, a: number):flatbuffers.Offset {
  builder.prep(4, 4);
  builder.writeInt32(a);
  return builder.offset();
}

}

export class MyGame_OtherNameSpace_TableB {
  bb: flatbuffers.ByteBuffer|null = null;
  bb_pos = 0;
  __init(i:number, bb:flatbuffers.ByteBuffer):MyGame_OtherNameSpace_TableB {
  this.bb_pos = i;
  this.bb = bb;
  return this;
}

static getRootAsTableB(bb:flatbuffers.ByteBuffer, obj?:MyGame_OtherNameSpace_TableB):MyGame_OtherNameSpace_TableB {
  return (obj || new MyGame_OtherNameSpace_TableB()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}

static getSizePrefixedRootAsTableB(bb:flatbuffers.ByteBuffer, obj?:MyGame_OtherNameSpace_TableB):MyGame_OtherNameSpace_TableB {
  bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
  return (obj || new MyGame_OtherNameSpace_TableB()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}

a(obj?:TableA):TableA|null {
  const offset = this.bb!.__offset(this.bb_pos, 4);
  return offset ? (obj || new TableA()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
}

static startTableB(builder:flatbuffers.Builder) {
  builder.startObject(1);
}

static addA(builder:flatbuffers.Builder, aOffset:flatbuffers.Offset) {
  builder.addFieldOffset(0, aOffset, 0);
}

static endTableB(builder:flatbuffers.Builder):flatbuffers.Offset {
  const offset = builder.endObject();
  return offset;
}

static createTableB(builder:flatbuffers.Builder, aOffset:flatbuffers.Offset):flatbuffers.Offset {
  MyGame_OtherNameSpace_TableB.startTableB(builder);
  MyGame_OtherNameSpace_TableB.addA(builder, aOffset);
  return MyGame_OtherNameSpace_TableB.endTableB(builder);
}

serialize():Uint8Array {
  return this.bb!.bytes();
}

static deserialize(buffer: Uint8Array):TableB {
  return MyGame_OtherNameSpace_TableB.getRootAsTableB(new flatbuffers.ByteBuffer(buffer))
}
}

export class TableA {
  bb: flatbuffers.ByteBuffer|null = null;
  bb_pos = 0;
  __init(i:number, bb:flatbuffers.ByteBuffer):TableA {
  this.bb_pos = i;
  this.bb = bb;
  return this;
}

static getRootAsTableA(bb:flatbuffers.ByteBuffer, obj?:TableA):TableA {
  return (obj || new TableA()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}

static getSizePrefixedRootAsTableA(bb:flatbuffers.ByteBuffer, obj?:TableA):TableA {
  bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
  return (obj || new TableA()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}

b(obj?:MyGame_OtherNameSpace_TableB):MyGame_OtherNameSpace_TableB|null {
  const offset = this.bb!.__offset(this.bb_pos, 4);
  return offset ? (obj || new MyGame_OtherNameSpace_TableB()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
}

static startTableA(builder:flatbuffers.Builder) {
  builder.startObject(1);
}

static addB(builder:flatbuffers.Builder, bOffset:flatbuffers.Offset) {
  builder.addFieldOffset(0, bOffset, 0);
}

static endTableA(builder:flatbuffers.Builder):flatbuffers.Offset {
  const offset = builder.endObject();
  return offset;
}

static createTableA(builder:flatbuffers.Builder, bOffset:flatbuffers.Offset):flatbuffers.Offset {
  TableA.startTableA(builder);
  TableA.addB(builder, bOffset);
  return TableA.endTableA(builder);
}

serialize():Uint8Array {
  return this.bb!.bytes();
}

static deserialize(buffer: Uint8Array):TableA {
  return TableA.getRootAsTableA(new flatbuffers.ByteBuffer(buffer))
}
}

export class MyGame_InParentNamespace {
  bb: flatbuffers.ByteBuffer|null = null;
  bb_pos = 0;
  __init(i:number, bb:flatbuffers.ByteBuffer):MyGame_InParentNamespace {
  this.bb_pos = i;
  this.bb = bb;
  return this;
}

static getRootAsInParentNamespace(bb:flatbuffers.ByteBuffer, obj?:MyGame_InParentNamespace):MyGame_InParentNamespace {
  return (obj || new MyGame_InParentNamespace()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}

static getSizePrefixedRootAsInParentNamespace(bb:flatbuffers.ByteBuffer, obj?:MyGame_InParentNamespace):MyGame_InParentNamespace {
  bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
  return (obj || new MyGame_InParentNamespace()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}

static startInParentNamespace(builder:flatbuffers.Builder) {
  builder.startObject(0);
}

static endInParentNamespace(builder:flatbuffers.Builder):flatbuffers.Offset {
  const offset = builder.endObject();
  return offset;
}

static createInParentNamespace(builder:flatbuffers.Builder):flatbuffers.Offset {
  MyGame_InParentNamespace.startInParentNamespace(builder);
  return MyGame_InParentNamespace.endInParentNamespace(builder);
}

serialize():Uint8Array {
  return this.bb!.bytes();
}

static deserialize(buffer: Uint8Array):InParentNamespace {
  return MyGame_InParentNamespace.getRootAsInParentNamespace(new flatbuffers.ByteBuffer(buffer))
}
}

export class MyGame_Example2_Monster {
  bb: flatbuffers.ByteBuffer|null = null;
  bb_pos = 0;
  __init(i:number, bb:flatbuffers.ByteBuffer):MyGame_Example2_Monster {
  this.bb_pos = i;
  this.bb = bb;
  return this;
}

static getRootAsMonster(bb:flatbuffers.ByteBuffer, obj?:MyGame_Example2_Monster):MyGame_Example2_Monster {
  return (obj || new MyGame_Example2_Monster()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}

static getSizePrefixedRootAsMonster(bb:flatbuffers.ByteBuffer, obj?:MyGame_Example2_Monster):MyGame_Example2_Monster {
  bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
  return (obj || new MyGame_Example2_Monster()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}

static startMonster(builder:flatbuffers.Builder) {
  builder.startObject(0);
}

static endMonster(builder:flatbuffers.Builder):flatbuffers.Offset {
  const offset = builder.endObject();
  return offset;
}

static createMonster(builder:flatbuffers.Builder):flatbuffers.Offset {
  MyGame_Example2_Monster.startMonster(builder);
  return MyGame_Example2_Monster.endMonster(builder);
}

serialize():Uint8Array {
  return this.bb!.bytes();
}

static deserialize(buffer: Uint8Array):Monster {
  return MyGame_Example2_Monster.getRootAsMonster(new flatbuffers.ByteBuffer(buffer))
}
}

export class MyGame_Example_Test {
  bb: flatbuffers.ByteBuffer|null = null;
  bb_pos = 0;
  __init(i:number, bb:flatbuffers.ByteBuffer):MyGame_Example_Test {
  this.bb_pos = i;
  this.bb = bb;
  return this;
}

a():number {
  return this.bb!.readInt16(this.bb_pos);
}

b():number {
  return this.bb!.readInt8(this.bb_pos + 2);
}

static sizeOf():number {
  return 4;
}

static createTest(builder:flatbuffers.Builder, a: number, b: number):flatbuffers.Offset {
  builder.prep(2, 4);
  builder.pad(1);
  builder.writeInt8(b);
  builder.writeInt16(a);
  return builder.offset();
}

}

export class MyGame_Example_TestSimpleTableWithEnum {
  bb: flatbuffers.ByteBuffer|null = null;
  bb_pos = 0;
  __init(i:number, bb:flatbuffers.ByteBuffer):MyGame_Example_TestSimpleTableWithEnum {
  this.bb_pos = i;
  this.bb = bb;
  return this;
}

static getRootAsTestSimpleTableWithEnum(bb:flatbuffers.ByteBuffer, obj?:MyGame_Example_TestSimpleTableWithEnum):MyGame_Example_TestSimpleTableWithEnum {
  return (obj || new MyGame_Example_TestSimpleTableWithEnum()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}

static getSizePrefixedRootAsTestSimpleTableWithEnum(bb:flatbuffers.ByteBuffer, obj?:MyGame_Example_TestSimpleTableWithEnum):MyGame_Example_TestSimpleTableWithEnum {
  bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
  return (obj || new MyGame_Example_TestSimpleTableWithEnum()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}

color():MyGame_Example_Color {
  const offset = this.bb!.__offset(this.bb_pos, 4);
  return offset ? this.bb!.readUint8(this.bb_pos + offset) : MyGame_Example_Color.Green;
}

static startTestSimpleTableWithEnum(builder:flatbuffers.Builder) {
  builder.startObject(1);
}

static addColor(builder:flatbuffers.Builder, color:MyGame_Example_Color) {
  builder.addFieldInt8(0, color, MyGame_Example_Color.Green);
}

static endTestSimpleTableWithEnum(builder:flatbuffers.Builder):flatbuffers.Offset {
  const offset = builder.endObject();
  return offset;
}

static createTestSimpleTableWithEnum(builder:flatbuffers.Builder, color:MyGame_Example_Color):flatbuffers.Offset {
  MyGame_Example_TestSimpleTableWithEnum.startTestSimpleTableWithEnum(builder);
  MyGame_Example_TestSimpleTableWithEnum.addColor(builder, color);
  return MyGame_Example_TestSimpleTableWithEnum.endTestSimpleTableWithEnum(builder);
}

serialize():Uint8Array {
  return this.bb!.bytes();
}

static deserialize(buffer: Uint8Array):TestSimpleTableWithEnum {
  return MyGame_Example_TestSimpleTableWithEnum.getRootAsTestSimpleTableWithEnum(new flatbuffers.ByteBuffer(buffer))
}
}

export class MyGame_Example_Vec3 {
  bb: flatbuffers.ByteBuffer|null = null;
  bb_pos = 0;
  __init(i:number, bb:flatbuffers.ByteBuffer):MyGame_Example_Vec3 {
  this.bb_pos = i;
  this.bb = bb;
  return this;
}

x():number {
  return this.bb!.readFloat32(this.bb_pos);
}

y():number {
  return this.bb!.readFloat32(this.bb_pos + 4);
}

z():number {
  return this.bb!.readFloat32(this.bb_pos + 8);
}

test1():number {
  return this.bb!.readFloat64(this.bb_pos + 16);
}

test2():MyGame_Example_Color {
  return this.bb!.readUint8(this.bb_pos + 24);
}

test3(obj?:MyGame_Example_Test):MyGame_Example_Test|null {
  return (obj || new MyGame_Example_Test()).__init(this.bb_pos + 26, this.bb!);
}

static sizeOf():number {
  return 32;
}

static createVec3(builder:flatbuffers.Builder, x: number, y: number, z: number, test1: number, test2: MyGame_Example_Color, test3_a: number, test3_b: number):flatbuffers.Offset {
  builder.prep(8, 32);
  builder.pad(2);
  builder.prep(2, 4);
  builder.pad(1);
  builder.writeInt8(test3_b);
  builder.writeInt16(test3_a);
  builder.pad(1);
  builder.writeInt8(test2);
  builder.writeFloat64(test1);
  builder.pad(4);
  builder.writeFloat32(z);
  builder.writeFloat32(y);
  builder.writeFloat32(x);
  return builder.offset();
}

}

export class MyGame_Example_Ability {
  bb: flatbuffers.ByteBuffer|null = null;
  bb_pos = 0;
  __init(i:number, bb:flatbuffers.ByteBuffer):MyGame_Example_Ability {
  this.bb_pos = i;
  this.bb = bb;
  return this;
}

id():number {
  return this.bb!.readUint32(this.bb_pos);
}

distance():number {
  return this.bb!.readUint32(this.bb_pos + 4);
}

static sizeOf():number {
  return 8;
}

static createAbility(builder:flatbuffers.Builder, id: number, distance: number):flatbuffers.Offset {
  builder.prep(4, 8);
  builder.writeInt32(distance);
  builder.writeInt32(id);
  return builder.offset();
}

}

export class MyGame_Example_StructOfStructs {
  bb: flatbuffers.ByteBuffer|null = null;
  bb_pos = 0;
  __init(i:number, bb:flatbuffers.ByteBuffer):MyGame_Example_StructOfStructs {
  this.bb_pos = i;
  this.bb = bb;
  return this;
}

a(obj?:MyGame_Example_Ability):MyGame_Example_Ability|null {
  return (obj || new MyGame_Example_Ability()).__init(this.bb_pos, this.bb!);
}

b(obj?:MyGame_Example_Test):MyGame_Example_Test|null {
  return (obj || new MyGame_Example_Test()).__init(this.bb_pos + 8, this.bb!);
}

c(obj?:MyGame_Example_Ability):MyGame_Example_Ability|null {
  return (obj || new MyGame_Example_Ability()).__init(this.bb_pos + 12, this.bb!);
}

static sizeOf():number {
  return 20;
}

static createStructOfStructs(builder:flatbuffers.Builder, a_id: number, a_distance: number, b_a: number, b_b: number, c_id: number, c_distance: number):flatbuffers.Offset {
  builder.prep(4, 20);
  builder.prep(4, 8);
  builder.writeInt32(c_distance);
  builder.writeInt32(c_id);
  builder.prep(2, 4);
  builder.pad(1);
  builder.writeInt8(b_b);
  builder.writeInt16(b_a);
  builder.prep(4, 8);
  builder.writeInt32(a_distance);
  builder.writeInt32(a_id);
  return builder.offset();
}

}

export class MyGame_Example_StructOfStructsOfStructs {
  bb: flatbuffers.ByteBuffer|null = null;
  bb_pos = 0;
  __init(i:number, bb:flatbuffers.ByteBuffer):MyGame_Example_StructOfStructsOfStructs {
  this.bb_pos = i;
  this.bb = bb;
  return this;
}

a(obj?:MyGame_Example_StructOfStructs):MyGame_Example_StructOfStructs|null {
  return (obj || new MyGame_Example_StructOfStructs()).__init(this.bb_pos, this.bb!);
}

static sizeOf():number {
  return 20;
}

static createStructOfStructsOfStructs(builder:flatbuffers.Builder, a_a_id: number, a_a_distance: number, a_b_a: number, a_b_b: number, a_c_id: number, a_c_distance: number):flatbuffers.Offset {
  builder.prep(4, 20);
  builder.prep(4, 20);
  builder.prep(4, 8);
  builder.writeInt32(a_c_distance);
  builder.writeInt32(a_c_id);
  builder.prep(2, 4);
  builder.pad(1);
  builder.writeInt8(a_b_b);
  builder.writeInt16(a_b_a);
  builder.prep(4, 8);
  builder.writeInt32(a_a_distance);
  builder.writeInt32(a_a_id);
  return builder.offset();
}

}

export class MyGame_Example_Stat {
  bb: flatbuffers.ByteBuffer|null = null;
  bb_pos = 0;
  __init(i:number, bb:flatbuffers.ByteBuffer):MyGame_Example_Stat {
  this.bb_pos = i;
  this.bb = bb;
  return this;
}

static getRootAsStat(bb:flatbuffers.ByteBuffer, obj?:MyGame_Example_Stat):MyGame_Example_Stat {
  return (obj || new MyGame_Example_Stat()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}

static getSizePrefixedRootAsStat(bb:flatbuffers.ByteBuffer, obj?:MyGame_Example_Stat):MyGame_Example_Stat {
  bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
  return (obj || new MyGame_Example_Stat()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}

id():string|null
id(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
id(optionalEncoding?:any):string|Uint8Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 4);
  return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
}

val():bigint {
  const offset = this.bb!.__offset(this.bb_pos, 6);
  return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0');
}

count():number {
  const offset = this.bb!.__offset(this.bb_pos, 8);
  return offset ? this.bb!.readUint16(this.bb_pos + offset) : 0;
}

static startStat(builder:flatbuffers.Builder) {
  builder.startObject(3);
}

static addId(builder:flatbuffers.Builder, idOffset:flatbuffers.Offset) {
  builder.addFieldOffset(0, idOffset, 0);
}

static addVal(builder:flatbuffers.Builder, val:bigint) {
  builder.addFieldInt64(1, val, BigInt('0'));
}

static addCount(builder:flatbuffers.Builder, count:number) {
  builder.addFieldInt16(2, count, 0);
}

static endStat(builder:flatbuffers.Builder):flatbuffers.Offset {
  const offset = builder.endObject();
  return offset;
}

static createStat(builder:flatbuffers.Builder, idOffset:flatbuffers.Offset, val:bigint, count:number):flatbuffers.Offset {
  MyGame_Example_Stat.startStat(builder);
  MyGame_Example_Stat.addId(builder, idOffset);
  MyGame_Example_Stat.addVal(builder, val);
  MyGame_Example_Stat.addCount(builder, count);
  return MyGame_Example_Stat.endStat(builder);
}

serialize():Uint8Array {
  return this.bb!.bytes();
}

static deserialize(buffer: Uint8Array):Stat {
  return MyGame_Example_Stat.getRootAsStat(new flatbuffers.ByteBuffer(buffer))
}
}

export class MyGame_Example_Referrable {
  bb: flatbuffers.ByteBuffer|null = null;
  bb_pos = 0;
  __init(i:number, bb:flatbuffers.ByteBuffer):MyGame_Example_Referrable {
  this.bb_pos = i;
  this.bb = bb;
  return this;
}

static getRootAsReferrable(bb:flatbuffers.ByteBuffer, obj?:MyGame_Example_Referrable):MyGame_Example_Referrable {
  return (obj || new MyGame_Example_Referrable()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}

static getSizePrefixedRootAsReferrable(bb:flatbuffers.ByteBuffer, obj?:MyGame_Example_Referrable):MyGame_Example_Referrable {
  bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
  return (obj || new MyGame_Example_Referrable()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}

id():bigint {
  const offset = this.bb!.__offset(this.bb_pos, 4);
  return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0');
}

static startReferrable(builder:flatbuffers.Builder) {
  builder.startObject(1);
}

static addId(builder:flatbuffers.Builder, id:bigint) {
  builder.addFieldInt64(0, id, BigInt('0'));
}

static endReferrable(builder:flatbuffers.Builder):flatbuffers.Offset {
  const offset = builder.endObject();
  return offset;
}

static createReferrable(builder:flatbuffers.Builder, id:bigint):flatbuffers.Offset {
  MyGame_Example_Referrable.startReferrable(builder);
  MyGame_Example_Referrable.addId(builder, id);
  return MyGame_Example_Referrable.endReferrable(builder);
}

serialize():Uint8Array {
  return this.bb!.bytes();
}

static deserialize(buffer: Uint8Array):Referrable {
  return MyGame_Example_Referrable.getRootAsReferrable(new flatbuffers.ByteBuffer(buffer))
}
}

/**
 * an example documentation comment: "monster object"
 */
export class MyGame_Example_Monster {
  bb: flatbuffers.ByteBuffer|null = null;
  bb_pos = 0;
  __init(i:number, bb:flatbuffers.ByteBuffer):MyGame_Example_Monster {
  this.bb_pos = i;
  this.bb = bb;
  return this;
}

static getRootAsMonster(bb:flatbuffers.ByteBuffer, obj?:MyGame_Example_Monster):MyGame_Example_Monster {
  return (obj || new MyGame_Example_Monster()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}

static getSizePrefixedRootAsMonster(bb:flatbuffers.ByteBuffer, obj?:MyGame_Example_Monster):MyGame_Example_Monster {
  bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
  return (obj || new MyGame_Example_Monster()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}

static bufferHasIdentifier(bb:flatbuffers.ByteBuffer):boolean {
  return bb.__has_identifier('MONS');
}

pos(obj?:MyGame_Example_Vec3):MyGame_Example_Vec3|null {
  const offset = this.bb!.__offset(this.bb_pos, 4);
  return offset ? (obj || new MyGame_Example_Vec3()).__init(this.bb_pos + offset, this.bb!) : null;
}

mana():number {
  const offset = this.bb!.__offset(this.bb_pos, 6);
  return offset ? this.bb!.readInt16(this.bb_pos + offset) : 150;
}

hp():number {
  const offset = this.bb!.__offset(this.bb_pos, 8);
  return offset ? this.bb!.readInt16(this.bb_pos + offset) : 100;
}

name():string|null
name(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
name(optionalEncoding?:any):string|Uint8Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 10);
  return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
}

inventory(index: number):number|null {
  const offset = this.bb!.__offset(this.bb_pos, 14);
  return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0;
}

inventoryLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 14);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

inventoryArray():Uint8Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 14);
  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;
}

color():MyGame_Example_Color {
  const offset = this.bb!.__offset(this.bb_pos, 16);
  return offset ? this.bb!.readUint8(this.bb_pos + offset) : MyGame_Example_Color.Blue;
}

testType():MyGame_Example_Any {
  const offset = this.bb!.__offset(this.bb_pos, 18);
  return offset ? this.bb!.readUint8(this.bb_pos + offset) : MyGame_Example_Any.NONE;
}

test<T extends flatbuffers.Table>(obj:any):any|null {
  const offset = this.bb!.__offset(this.bb_pos, 20);
  return offset ? this.bb!.__union(obj, this.bb_pos + offset) : null;
}

test4(index: number, obj?:MyGame_Example_Test):MyGame_Example_Test|null {
  const offset = this.bb!.__offset(this.bb_pos, 22);
  return offset ? (obj || new MyGame_Example_Test()).__init(this.bb!.__vector(this.bb_pos + offset) + index * 4, this.bb!) : null;
}

test4Length():number {
  const offset = this.bb!.__offset(this.bb_pos, 22);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

testarrayofstring(index: number):string
testarrayofstring(index: number,optionalEncoding:flatbuffers.Encoding):string|Uint8Array
testarrayofstring(index: number,optionalEncoding?:any):string|Uint8Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 24);
  return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
}

testarrayofstringLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 24);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

/**
 * an example documentation comment: this will end up in the generated code
 * multiline too
 */
testarrayoftables(index: number, obj?:MyGame_Example_Monster):MyGame_Example_Monster|null {
  const offset = this.bb!.__offset(this.bb_pos, 26);
  return offset ? (obj || new MyGame_Example_Monster()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
}

testarrayoftablesLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 26);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

enemy(obj?:MyGame_Example_Monster):MyGame_Example_Monster|null {
  const offset = this.bb!.__offset(this.bb_pos, 28);
  return offset ? (obj || new MyGame_Example_Monster()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
}

testnestedflatbuffer(index: number):number|null {
  const offset = this.bb!.__offset(this.bb_pos, 30);
  return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0;
}

testnestedflatbufferLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 30);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

testnestedflatbufferArray():Uint8Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 30);
  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;
}

testempty(obj?:MyGame_Example_Stat):MyGame_Example_Stat|null {
  const offset = this.bb!.__offset(this.bb_pos, 32);
  return offset ? (obj || new MyGame_Example_Stat()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
}

testbool():boolean {
  const offset = this.bb!.__offset(this.bb_pos, 34);
  return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
}

testhashs32Fnv1():number {
  const offset = this.bb!.__offset(this.bb_pos, 36);
  return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
}

testhashu32Fnv1():number {
  const offset = this.bb!.__offset(this.bb_pos, 38);
  return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;
}

testhashs64Fnv1():bigint {
  const offset = this.bb!.__offset(this.bb_pos, 40);
  return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0');
}

testhashu64Fnv1():bigint {
  const offset = this.bb!.__offset(this.bb_pos, 42);
  return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0');
}

testhashs32Fnv1a():number {
  const offset = this.bb!.__offset(this.bb_pos, 44);
  return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
}

testhashu32Fnv1a():number {
  const offset = this.bb!.__offset(this.bb_pos, 46);
  return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;
}

testhashs64Fnv1a():bigint {
  const offset = this.bb!.__offset(this.bb_pos, 48);
  return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0');
}

testhashu64Fnv1a():bigint {
  const offset = this.bb!.__offset(this.bb_pos, 50);
  return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0');
}

testarrayofbools(index: number):boolean|null {
  const offset = this.bb!.__offset(this.bb_pos, 52);
  return offset ? !!this.bb!.readInt8(this.bb!.__vector(this.bb_pos + offset) + index) : false;
}

testarrayofboolsLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 52);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

testarrayofboolsArray():Int8Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 52);
  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;
}

testf():number {
  const offset = this.bb!.__offset(this.bb_pos, 54);
  return offset ? this.bb!.readFloat32(this.bb_pos + offset) : 3.14159;
}

testf2():number {
  const offset = this.bb!.__offset(this.bb_pos, 56);
  return offset ? this.bb!.readFloat32(this.bb_pos + offset) : 3.0;
}

testf3():number {
  const offset = this.bb!.__offset(this.bb_pos, 58);
  return offset ? this.bb!.readFloat32(this.bb_pos + offset) : 0.0;
}

testarrayofstring2(index: number):string
testarrayofstring2(index: number,optionalEncoding:flatbuffers.Encoding):string|Uint8Array
testarrayofstring2(index: number,optionalEncoding?:any):string|Uint8Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 60);
  return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
}

testarrayofstring2Length():number {
  const offset = this.bb!.__offset(this.bb_pos, 60);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

testarrayofsortedstruct(index: number, obj?:MyGame_Example_Ability):MyGame_Example_Ability|null {
  const offset = this.bb!.__offset(this.bb_pos, 62);
  return offset ? (obj || new MyGame_Example_Ability()).__init(this.bb!.__vector(this.bb_pos + offset) + index * 8, this.bb!) : null;
}

testarrayofsortedstructLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 62);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

flex(index: number):number|null {
  const offset = this.bb!.__offset(this.bb_pos, 64);
  return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0;
}

flexLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 64);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

flexArray():Uint8Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 64);
  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;
}

test5(index: number, obj?:MyGame_Example_Test):MyGame_Example_Test|null {
  const offset = this.bb!.__offset(this.bb_pos, 66);
  return offset ? (obj || new MyGame_Example_Test()).__init(this.bb!.__vector(this.bb_pos + offset) + index * 4, this.bb!) : null;
}

test5Length():number {
  const offset = this.bb!.__offset(this.bb_pos, 66);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

vectorOfLongs(index: number):bigint|null {
  const offset = this.bb!.__offset(this.bb_pos, 68);
  return offset ? this.bb!.readInt64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : BigInt(0);
}

vectorOfLongsLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 68);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

vectorOfDoubles(index: number):number|null {
  const offset = this.bb!.__offset(this.bb_pos, 70);
  return offset ? this.bb!.readFloat64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : 0;
}

vectorOfDoublesLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 70);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

vectorOfDoublesArray():Float64Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 70);
  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;
}

parentNamespaceTest(obj?:MyGame_InParentNamespace):MyGame_InParentNamespace|null {
  const offset = this.bb!.__offset(this.bb_pos, 72);
  return offset ? (obj || new MyGame_InParentNamespace()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
}

vectorOfReferrables(index: number, obj?:MyGame_Example_Referrable):MyGame_Example_Referrable|null {
  const offset = this.bb!.__offset(this.bb_pos, 74);
  return offset ? (obj || new MyGame_Example_Referrable()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
}

vectorOfReferrablesLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 74);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

singleWeakReference():bigint {
  const offset = this.bb!.__offset(this.bb_pos, 76);
  return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0');
}

vectorOfWeakReferences(index: number):bigint|null {
  const offset = this.bb!.__offset(this.bb_pos, 78);
  return offset ? this.bb!.readUint64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : BigInt(0);
}

vectorOfWeakReferencesLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 78);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

vectorOfStrongReferrables(index: number, obj?:MyGame_Example_Referrable):MyGame_Example_Referrable|null {
  const offset = this.bb!.__offset(this.bb_pos, 80);
  return offset ? (obj || new MyGame_Example_Referrable()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
}

vectorOfStrongReferrablesLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 80);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

coOwningReference():bigint {
  const offset = this.bb!.__offset(this.bb_pos, 82);
  return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0');
}

vectorOfCoOwningReferences(index: number):bigint|null {
  const offset = this.bb!.__offset(this.bb_pos, 84);
  return offset ? this.bb!.readUint64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : BigInt(0);
}

vectorOfCoOwningReferencesLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 84);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

nonOwningReference():bigint {
  const offset = this.bb!.__offset(this.bb_pos, 86);
  return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0');
}

vectorOfNonOwningReferences(index: number):bigint|null {
  const offset = this.bb!.__offset(this.bb_pos, 88);
  return offset ? this.bb!.readUint64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : BigInt(0);
}

vectorOfNonOwningReferencesLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 88);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

anyUniqueType():MyGame_Example_AnyUniqueAliases {
  const offset = this.bb!.__offset(this.bb_pos, 90);
  return offset ? this.bb!.readUint8(this.bb_pos + offset) : MyGame_Example_AnyUniqueAliases.NONE;
}

anyUnique<T extends flatbuffers.Table>(obj:any):any|null {
  const offset = this.bb!.__offset(this.bb_pos, 92);
  return offset ? this.bb!.__union(obj, this.bb_pos + offset) : null;
}

anyAmbiguousType():MyGame_Example_AnyAmbiguousAliases {
  const offset = this.bb!.__offset(this.bb_pos, 94);
  return offset ? this.bb!.readUint8(this.bb_pos + offset) : MyGame_Example_AnyAmbiguousAliases.NONE;
}

anyAmbiguous<T extends flatbuffers.Table>(obj:any):any|null {
  const offset = this.bb!.__offset(this.bb_pos, 96);
  return offset ? this.bb!.__union(obj, this.bb_pos + offset) : null;
}

vectorOfEnums(index: number):MyGame_Example_Color|null {
  const offset = this.bb!.__offset(this.bb_pos, 98);
  return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0;
}

vectorOfEnumsLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 98);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

vectorOfEnumsArray():Uint8Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 98);
  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;
}

signedEnum():MyGame_Example_Race {
  const offset = this.bb!.__offset(this.bb_pos, 100);
  return offset ? this.bb!.readInt8(this.bb_pos + offset) : MyGame_Example_Race.None;
}

testrequirednestedflatbuffer(index: number):number|null {
  const offset = this.bb!.__offset(this.bb_pos, 102);
  return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0;
}

testrequirednestedflatbufferLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 102);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

testrequirednestedflatbufferArray():Uint8Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 102);
  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;
}

scalarKeySortedTables(index: number, obj?:MyGame_Example_Stat):MyGame_Example_Stat|null {
  const offset = this.bb!.__offset(this.bb_pos, 104);
  return offset ? (obj || new MyGame_Example_Stat()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
}

scalarKeySortedTablesLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 104);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

nativeInline(obj?:MyGame_Example_Test):MyGame_Example_Test|null {
  const offset = this.bb!.__offset(this.bb_pos, 106);
  return offset ? (obj || new MyGame_Example_Test()).__init(this.bb_pos + offset, this.bb!) : null;
}

longEnumNonEnumDefault():bigint {
  const offset = this.bb!.__offset(this.bb_pos, 108);
  return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0');
}

longEnumNormalDefault():bigint {
  const offset = this.bb!.__offset(this.bb_pos, 110);
  return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('2');
}

nanDefault():number {
  const offset = this.bb!.__offset(this.bb_pos, 112);
  return offset ? this.bb!.readFloat32(this.bb_pos + offset) : NaN;
}

infDefault():number {
  const offset = this.bb!.__offset(this.bb_pos, 114);
  return offset ? this.bb!.readFloat32(this.bb_pos + offset) : Infinity;
}

positiveInfDefault():number {
  const offset = this.bb!.__offset(this.bb_pos, 116);
  return offset ? this.bb!.readFloat32(this.bb_pos + offset) : Infinity;
}

infinityDefault():number {
  const offset = this.bb!.__offset(this.bb_pos, 118);
  return offset ? this.bb!.readFloat32(this.bb_pos + offset) : Infinity;
}

positiveInfinityDefault():number {
  const offset = this.bb!.__offset(this.bb_pos, 120);
  return offset ? this.bb!.readFloat32(this.bb_pos + offset) : Infinity;
}

negativeInfDefault():number {
  const offset = this.bb!.__offset(this.bb_pos, 122);
  return offset ? this.bb!.readFloat32(this.bb_pos + offset) : -Infinity;
}

negativeInfinityDefault():number {
  const offset = this.bb!.__offset(this.bb_pos, 124);
  return offset ? this.bb!.readFloat32(this.bb_pos + offset) : -Infinity;
}

doubleInfDefault():number {
  const offset = this.bb!.__offset(this.bb_pos, 126);
  return offset ? this.bb!.readFloat64(this.bb_pos + offset) : Infinity;
}

static startMonster(builder:flatbuffers.Builder) {
  builder.startObject(62);
}

static addPos(builder:flatbuffers.Builder, posOffset:flatbuffers.Offset) {
  builder.addFieldStruct(0, posOffset, 0);
}

static addMana(builder:flatbuffers.Builder, mana:number) {
  builder.addFieldInt16(1, mana, 150);
}

static addHp(builder:flatbuffers.Builder, hp:number) {
  builder.addFieldInt16(2, hp, 100);
}

static addName(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset) {
  builder.addFieldOffset(3, nameOffset, 0);
}

static addInventory(builder:flatbuffers.Builder, inventoryOffset:flatbuffers.Offset) {
  builder.addFieldOffset(5, inventoryOffset, 0);
}

static createInventoryVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset {
  builder.startVector(1, data.length, 1);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addInt8(data[i]!);
  }
  return builder.endVector();
}

static startInventoryVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(1, numElems, 1);
}

static addColor(builder:flatbuffers.Builder, color:MyGame_Example_Color) {
  builder.addFieldInt8(6, color, MyGame_Example_Color.Blue);
}

static addTestType(builder:flatbuffers.Builder, testType:MyGame_Example_Any) {
  builder.addFieldInt8(7, testType, MyGame_Example_Any.NONE);
}

static addTest(builder:flatbuffers.Builder, testOffset:flatbuffers.Offset) {
  builder.addFieldOffset(8, testOffset, 0);
}

static addTest4(builder:flatbuffers.Builder, test4Offset:flatbuffers.Offset) {
  builder.addFieldOffset(9, test4Offset, 0);
}

static startTest4Vector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(4, numElems, 2);
}

static addTestarrayofstring(builder:flatbuffers.Builder, testarrayofstringOffset:flatbuffers.Offset) {
  builder.addFieldOffset(10, testarrayofstringOffset, 0);
}

static createTestarrayofstringVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
  builder.startVector(4, data.length, 4);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addOffset(data[i]!);
  }
  return builder.endVector();
}

static startTestarrayofstringVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(4, numElems, 4);
}

static addTestarrayoftables(builder:flatbuffers.Builder, testarrayoftablesOffset:flatbuffers.Offset) {
  builder.addFieldOffset(11, testarrayoftablesOffset, 0);
}

static createTestarrayoftablesVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
  builder.startVector(4, data.length, 4);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addOffset(data[i]!);
  }
  return builder.endVector();
}

static startTestarrayoftablesVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(4, numElems, 4);
}

static addEnemy(builder:flatbuffers.Builder, enemyOffset:flatbuffers.Offset) {
  builder.addFieldOffset(12, enemyOffset, 0);
}

static addTestnestedflatbuffer(builder:flatbuffers.Builder, testnestedflatbufferOffset:flatbuffers.Offset) {
  builder.addFieldOffset(13, testnestedflatbufferOffset, 0);
}

static createTestnestedflatbufferVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset {
  builder.startVector(1, data.length, 1);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addInt8(data[i]!);
  }
  return builder.endVector();
}

static startTestnestedflatbufferVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(1, numElems, 1);
}

static addTestempty(builder:flatbuffers.Builder, testemptyOffset:flatbuffers.Offset) {
  builder.addFieldOffset(14, testemptyOffset, 0);
}

static addTestbool(builder:flatbuffers.Builder, testbool:boolean) {
  builder.addFieldInt8(15, +testbool, +false);
}

static addTesthashs32Fnv1(builder:flatbuffers.Builder, testhashs32Fnv1:number) {
  builder.addFieldInt32(16, testhashs32Fnv1, 0);
}

static addTesthashu32Fnv1(builder:flatbuffers.Builder, testhashu32Fnv1:number) {
  builder.addFieldInt32(17, testhashu32Fnv1, 0);
}

static addTesthashs64Fnv1(builder:flatbuffers.Builder, testhashs64Fnv1:bigint) {
  builder.addFieldInt64(18, testhashs64Fnv1, BigInt('0'));
}

static addTesthashu64Fnv1(builder:flatbuffers.Builder, testhashu64Fnv1:bigint) {
  builder.addFieldInt64(19, testhashu64Fnv1, BigInt('0'));
}

static addTesthashs32Fnv1a(builder:flatbuffers.Builder, testhashs32Fnv1a:number) {
  builder.addFieldInt32(20, testhashs32Fnv1a, 0);
}

static addTesthashu32Fnv1a(builder:flatbuffers.Builder, testhashu32Fnv1a:number) {
  builder.addFieldInt32(21, testhashu32Fnv1a, 0);
}

static addTesthashs64Fnv1a(builder:flatbuffers.Builder, testhashs64Fnv1a:bigint) {
  builder.addFieldInt64(22, testhashs64Fnv1a, BigInt('0'));
}

static addTesthashu64Fnv1a(builder:flatbuffers.Builder, testhashu64Fnv1a:bigint) {
  builder.addFieldInt64(23, testhashu64Fnv1a, BigInt('0'));
}

static addTestarrayofbools(builder:flatbuffers.Builder, testarrayofboolsOffset:flatbuffers.Offset) {
  builder.addFieldOffset(24, testarrayofboolsOffset, 0);
}

static createTestarrayofboolsVector(builder:flatbuffers.Builder, data:boolean[]):flatbuffers.Offset {
  builder.startVector(1, data.length, 1);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addInt8(+data[i]!);
  }
  return builder.endVector();
}

static startTestarrayofboolsVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(1, numElems, 1);
}

static addTestf(builder:flatbuffers.Builder, testf:number) {
  builder.addFieldFloat32(25, testf, 3.14159);
}

static addTestf2(builder:flatbuffers.Builder, testf2:number) {
  builder.addFieldFloat32(26, testf2, 3.0);
}

static addTestf3(builder:flatbuffers.Builder, testf3:number) {
  builder.addFieldFloat32(27, testf3, 0.0);
}

static addTestarrayofstring2(builder:flatbuffers.Builder, testarrayofstring2Offset:flatbuffers.Offset) {
  builder.addFieldOffset(28, testarrayofstring2Offset, 0);
}

static createTestarrayofstring2Vector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
  builder.startVector(4, data.length, 4);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addOffset(data[i]!);
  }
  return builder.endVector();
}

static startTestarrayofstring2Vector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(4, numElems, 4);
}

static addTestarrayofsortedstruct(builder:flatbuffers.Builder, testarrayofsortedstructOffset:flatbuffers.Offset) {
  builder.addFieldOffset(29, testarrayofsortedstructOffset, 0);
}

static startTestarrayofsortedstructVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(8, numElems, 4);
}

static addFlex(builder:flatbuffers.Builder, flexOffset:flatbuffers.Offset) {
  builder.addFieldOffset(30, flexOffset, 0);
}

static createFlexVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset {
  builder.startVector(1, data.length, 1);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addInt8(data[i]!);
  }
  return builder.endVector();
}

static startFlexVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(1, numElems, 1);
}

static addTest5(builder:flatbuffers.Builder, test5Offset:flatbuffers.Offset) {
  builder.addFieldOffset(31, test5Offset, 0);
}

static startTest5Vector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(4, numElems, 2);
}

static addVectorOfLongs(builder:flatbuffers.Builder, vectorOfLongsOffset:flatbuffers.Offset) {
  builder.addFieldOffset(32, vectorOfLongsOffset, 0);
}

static createVectorOfLongsVector(builder:flatbuffers.Builder, data:bigint[]):flatbuffers.Offset {
  builder.startVector(8, data.length, 8);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addInt64(data[i]!);
  }
  return builder.endVector();
}

static startVectorOfLongsVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(8, numElems, 8);
}

static addVectorOfDoubles(builder:flatbuffers.Builder, vectorOfDoublesOffset:flatbuffers.Offset) {
  builder.addFieldOffset(33, vectorOfDoublesOffset, 0);
}

static createVectorOfDoublesVector(builder:flatbuffers.Builder, data:number[]|Float64Array):flatbuffers.Offset;
/**
 * @deprecated This Uint8Array overload will be removed in the future.
 */
static createVectorOfDoublesVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset;
static createVectorOfDoublesVector(builder:flatbuffers.Builder, data:number[]|Float64Array|Uint8Array):flatbuffers.Offset {
  builder.startVector(8, data.length, 8);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addFloat64(data[i]!);
  }
  return builder.endVector();
}

static startVectorOfDoublesVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(8, numElems, 8);
}

static addParentNamespaceTest(builder:flatbuffers.Builder, parentNamespaceTestOffset:flatbuffers.Offset) {
  builder.addFieldOffset(34, parentNamespaceTestOffset, 0);
}

static addVectorOfReferrables(builder:flatbuffers.Builder, vectorOfReferrablesOffset:flatbuffers.Offset) {
  builder.addFieldOffset(35, vectorOfReferrablesOffset, 0);
}

static createVectorOfReferrablesVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
  builder.startVector(4, data.length, 4);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addOffset(data[i]!);
  }
  return builder.endVector();
}

static startVectorOfReferrablesVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(4, numElems, 4);
}

static addSingleWeakReference(builder:flatbuffers.Builder, singleWeakReference:bigint) {
  builder.addFieldInt64(36, singleWeakReference, BigInt('0'));
}

static addVectorOfWeakReferences(builder:flatbuffers.Builder, vectorOfWeakReferencesOffset:flatbuffers.Offset) {
  builder.addFieldOffset(37, vectorOfWeakReferencesOffset, 0);
}

static createVectorOfWeakReferencesVector(builder:flatbuffers.Builder, data:bigint[]):flatbuffers.Offset {
  builder.startVector(8, data.length, 8);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addInt64(data[i]!);
  }
  return builder.endVector();
}

static startVectorOfWeakReferencesVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(8, numElems, 8);
}

static addVectorOfStrongReferrables(builder:flatbuffers.Builder, vectorOfStrongReferrablesOffset:flatbuffers.Offset) {
  builder.addFieldOffset(38, vectorOfStrongReferrablesOffset, 0);
}

static createVectorOfStrongReferrablesVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
  builder.startVector(4, data.length, 4);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addOffset(data[i]!);
  }
  return builder.endVector();
}

static startVectorOfStrongReferrablesVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(4, numElems, 4);
}

static addCoOwningReference(builder:flatbuffers.Builder, coOwningReference:bigint) {
  builder.addFieldInt64(39, coOwningReference, BigInt('0'));
}

static addVectorOfCoOwningReferences(builder:flatbuffers.Builder, vectorOfCoOwningReferencesOffset:flatbuffers.Offset) {
  builder.addFieldOffset(40, vectorOfCoOwningReferencesOffset, 0);
}

static createVectorOfCoOwningReferencesVector(builder:flatbuffers.Builder, data:bigint[]):flatbuffers.Offset {
  builder.startVector(8, data.length, 8);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addInt64(data[i]!);
  }
  return builder.endVector();
}

static startVectorOfCoOwningReferencesVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(8, numElems, 8);
}

static addNonOwningReference(builder:flatbuffers.Builder, nonOwningReference:bigint) {
  builder.addFieldInt64(41, nonOwningReference, BigInt('0'));
}

static addVectorOfNonOwningReferences(builder:flatbuffers.Builder, vectorOfNonOwningReferencesOffset:flatbuffers.Offset) {
  builder.addFieldOffset(42, vectorOfNonOwningReferencesOffset, 0);
}

static createVectorOfNonOwningReferencesVector(builder:flatbuffers.Builder, data:bigint[]):flatbuffers.Offset {
  builder.startVector(8, data.length, 8);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addInt64(data[i]!);
  }
  return builder.endVector();
}

static startVectorOfNonOwningReferencesVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(8, numElems, 8);
}

static addAnyUniqueType(builder:flatbuffers.Builder, anyUniqueType:MyGame_Example_AnyUniqueAliases) {
  builder.addFieldInt8(43, anyUniqueType, MyGame_Example_AnyUniqueAliases.NONE);
}

static addAnyUnique(builder:flatbuffers.Builder, anyUniqueOffset:flatbuffers.Offset) {
  builder.addFieldOffset(44, anyUniqueOffset, 0);
}

static addAnyAmbiguousType(builder:flatbuffers.Builder, anyAmbiguousType:MyGame_Example_AnyAmbiguousAliases) {
  builder.addFieldInt8(45, anyAmbiguousType, MyGame_Example_AnyAmbiguousAliases.NONE);
}

static addAnyAmbiguous(builder:flatbuffers.Builder, anyAmbiguousOffset:flatbuffers.Offset) {
  builder.addFieldOffset(46, anyAmbiguousOffset, 0);
}

static addVectorOfEnums(builder:flatbuffers.Builder, vectorOfEnumsOffset:flatbuffers.Offset) {
  builder.addFieldOffset(47, vectorOfEnumsOffset, 0);
}

static createVectorOfEnumsVector(builder:flatbuffers.Builder, data:MyGame_Example_Color[]):flatbuffers.Offset {
  builder.startVector(1, data.length, 1);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addInt8(data[i]!);
  }
  return builder.endVector();
}

static startVectorOfEnumsVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(1, numElems, 1);
}

static addSignedEnum(builder:flatbuffers.Builder, signedEnum:MyGame_Example_Race) {
  builder.addFieldInt8(48, signedEnum, MyGame_Example_Race.None);
}

static addTestrequirednestedflatbuffer(builder:flatbuffers.Builder, testrequirednestedflatbufferOffset:flatbuffers.Offset) {
  builder.addFieldOffset(49, testrequirednestedflatbufferOffset, 0);
}

static createTestrequirednestedflatbufferVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset {
  builder.startVector(1, data.length, 1);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addInt8(data[i]!);
  }
  return builder.endVector();
}

static startTestrequirednestedflatbufferVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(1, numElems, 1);
}

static addScalarKeySortedTables(builder:flatbuffers.Builder, scalarKeySortedTablesOffset:flatbuffers.Offset) {
  builder.addFieldOffset(50, scalarKeySortedTablesOffset, 0);
}

static createScalarKeySortedTablesVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
  builder.startVector(4, data.length, 4);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addOffset(data[i]!);
  }
  return builder.endVector();
}

static startScalarKeySortedTablesVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(4, numElems, 4);
}

static addNativeInline(builder:flatbuffers.Builder, nativeInlineOffset:flatbuffers.Offset) {
  builder.addFieldStruct(51, nativeInlineOffset, 0);
}

static addLongEnumNonEnumDefault(builder:flatbuffers.Builder, longEnumNonEnumDefault:bigint) {
  builder.addFieldInt64(52, longEnumNonEnumDefault, BigInt('0'));
}

static addLongEnumNormalDefault(builder:flatbuffers.Builder, longEnumNormalDefault:bigint) {
  builder.addFieldInt64(53, longEnumNormalDefault, BigInt('2'));
}

static addNanDefault(builder:flatbuffers.Builder, nanDefault:number) {
  builder.addFieldFloat32(54, nanDefault, NaN);
}

static addInfDefault(builder:flatbuffers.Builder, infDefault:number) {
  builder.addFieldFloat32(55, infDefault, Infinity);
}

static addPositiveInfDefault(builder:flatbuffers.Builder, positiveInfDefault:number) {
  builder.addFieldFloat32(56, positiveInfDefault, Infinity);
}

static addInfinityDefault(builder:flatbuffers.Builder, infinityDefault:number) {
  builder.addFieldFloat32(57, infinityDefault, Infinity);
}

static addPositiveInfinityDefault(builder:flatbuffers.Builder, positiveInfinityDefault:number) {
  builder.addFieldFloat32(58, positiveInfinityDefault, Infinity);
}

static addNegativeInfDefault(builder:flatbuffers.Builder, negativeInfDefault:number) {
  builder.addFieldFloat32(59, negativeInfDefault, -Infinity);
}

static addNegativeInfinityDefault(builder:flatbuffers.Builder, negativeInfinityDefault:number) {
  builder.addFieldFloat32(60, negativeInfinityDefault, -Infinity);
}

static addDoubleInfDefault(builder:flatbuffers.Builder, doubleInfDefault:number) {
  builder.addFieldFloat64(61, doubleInfDefault, Infinity);
}

static endMonster(builder:flatbuffers.Builder):flatbuffers.Offset {
  const offset = builder.endObject();
  builder.requiredField(offset, 10) // name
  return offset;
}

static finishMonsterBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) {
  builder.finish(offset, 'MONS');
}

static finishSizePrefixedMonsterBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) {
  builder.finish(offset, 'MONS', true);
}


serialize():Uint8Array {
  return this.bb!.bytes();
}

static deserialize(buffer: Uint8Array):Monster {
  return MyGame_Example_Monster.getRootAsMonster(new flatbuffers.ByteBuffer(buffer))
}
}

export class MyGame_Example_TypeAliases {
  bb: flatbuffers.ByteBuffer|null = null;
  bb_pos = 0;
  __init(i:number, bb:flatbuffers.ByteBuffer):MyGame_Example_TypeAliases {
  this.bb_pos = i;
  this.bb = bb;
  return this;
}

static getRootAsTypeAliases(bb:flatbuffers.ByteBuffer, obj?:MyGame_Example_TypeAliases):MyGame_Example_TypeAliases {
  return (obj || new MyGame_Example_TypeAliases()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}

static getSizePrefixedRootAsTypeAliases(bb:flatbuffers.ByteBuffer, obj?:MyGame_Example_TypeAliases):MyGame_Example_TypeAliases {
  bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
  return (obj || new MyGame_Example_TypeAliases()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}

i8():number {
  const offset = this.bb!.__offset(this.bb_pos, 4);
  return offset ? this.bb!.readInt8(this.bb_pos + offset) : 0;
}

u8():number {
  const offset = this.bb!.__offset(this.bb_pos, 6);
  return offset ? this.bb!.readUint8(this.bb_pos + offset) : 0;
}

i16():number {
  const offset = this.bb!.__offset(this.bb_pos, 8);
  return offset ? this.bb!.readInt16(this.bb_pos + offset) : 0;
}

u16():number {
  const offset = this.bb!.__offset(this.bb_pos, 10);
  return offset ? this.bb!.readUint16(this.bb_pos + offset) : 0;
}

i32():number {
  const offset = this.bb!.__offset(this.bb_pos, 12);
  return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
}

u32():number {
  const offset = this.bb!.__offset(this.bb_pos, 14);
  return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;
}

i64():bigint {
  const offset = this.bb!.__offset(this.bb_pos, 16);
  return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0');
}

u64():bigint {
  const offset = this.bb!.__offset(this.bb_pos, 18);
  return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0');
}

f32():number {
  const offset = this.bb!.__offset(this.bb_pos, 20);
  return offset ? this.bb!.readFloat32(this.bb_pos + offset) : 0.0;
}

f64():number {
  const offset = this.bb!.__offset(this.bb_pos, 22);
  return offset ? this.bb!.readFloat64(this.bb_pos + offset) : 0.0;
}

v8(index: number):number|null {
  const offset = this.bb!.__offset(this.bb_pos, 24);
  return offset ? this.bb!.readInt8(this.bb!.__vector(this.bb_pos + offset) + index) : 0;
}

v8Length():number {
  const offset = this.bb!.__offset(this.bb_pos, 24);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

v8Array():Int8Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 24);
  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;
}

vf64(index: number):number|null {
  const offset = this.bb!.__offset(this.bb_pos, 26);
  return offset ? this.bb!.readFloat64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : 0;
}

vf64Length():number {
  const offset = this.bb!.__offset(this.bb_pos, 26);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

vf64Array():Float64Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 26);
  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;
}

static startTypeAliases(builder:flatbuffers.Builder) {
  builder.startObject(12);
}

static addI8(builder:flatbuffers.Builder, i8:number) {
  builder.addFieldInt8(0, i8, 0);
}

static addU8(builder:flatbuffers.Builder, u8:number) {
  builder.addFieldInt8(1, u8, 0);
}

static addI16(builder:flatbuffers.Builder, i16:number) {
  builder.addFieldInt16(2, i16, 0);
}

static addU16(builder:flatbuffers.Builder, u16:number) {
  builder.addFieldInt16(3, u16, 0);
}

static addI32(builder:flatbuffers.Builder, i32:number) {
  builder.addFieldInt32(4, i32, 0);
}

static addU32(builder:flatbuffers.Builder, u32:number) {
  builder.addFieldInt32(5, u32, 0);
}

static addI64(builder:flatbuffers.Builder, i64:bigint) {
  builder.addFieldInt64(6, i64, BigInt('0'));
}

static addU64(builder:flatbuffers.Builder, u64:bigint) {
  builder.addFieldInt64(7, u64, BigInt('0'));
}

static addF32(builder:flatbuffers.Builder, f32:number) {
  builder.addFieldFloat32(8, f32, 0.0);
}

static addF64(builder:flatbuffers.Builder, f64:number) {
  builder.addFieldFloat64(9, f64, 0.0);
}

static addV8(builder:flatbuffers.Builder, v8Offset:flatbuffers.Offset) {
  builder.addFieldOffset(10, v8Offset, 0);
}

static createV8Vector(builder:flatbuffers.Builder, data:number[]|Int8Array):flatbuffers.Offset;
/**
 * @deprecated This Uint8Array overload will be removed in the future.
 */
static createV8Vector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset;
static createV8Vector(builder:flatbuffers.Builder, data:number[]|Int8Array|Uint8Array):flatbuffers.Offset {
  builder.startVector(1, data.length, 1);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addInt8(data[i]!);
  }
  return builder.endVector();
}

static startV8Vector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(1, numElems, 1);
}

static addVf64(builder:flatbuffers.Builder, vf64Offset:flatbuffers.Offset) {
  builder.addFieldOffset(11, vf64Offset, 0);
}

static createVf64Vector(builder:flatbuffers.Builder, data:number[]|Float64Array):flatbuffers.Offset;
/**
 * @deprecated This Uint8Array overload will be removed in the future.
 */
static createVf64Vector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset;
static createVf64Vector(builder:flatbuffers.Builder, data:number[]|Float64Array|Uint8Array):flatbuffers.Offset {
  builder.startVector(8, data.length, 8);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addFloat64(data[i]!);
  }
  return builder.endVector();
}

static startVf64Vector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(8, numElems, 8);
}

static endTypeAliases(builder:flatbuffers.Builder):flatbuffers.Offset {
  const offset = builder.endObject();
  return offset;
}

static createTypeAliases(builder:flatbuffers.Builder, i8:number, u8:number, i16:number, u16:number, i32:number, u32:number, i64:bigint, u64:bigint, f32:number, f64:number, v8Offset:flatbuffers.Offset, vf64Offset:flatbuffers.Offset):flatbuffers.Offset {
  MyGame_Example_TypeAliases.startTypeAliases(builder);
  MyGame_Example_TypeAliases.addI8(builder, i8);
  MyGame_Example_TypeAliases.addU8(builder, u8);
  MyGame_Example_TypeAliases.addI16(builder, i16);
  MyGame_Example_TypeAliases.addU16(builder, u16);
  MyGame_Example_TypeAliases.addI32(builder, i32);
  MyGame_Example_TypeAliases.addU32(builder, u32);
  MyGame_Example_TypeAliases.addI64(builder, i64);
  MyGame_Example_TypeAliases.addU64(builder, u64);
  MyGame_Example_TypeAliases.addF32(builder, f32);
  MyGame_Example_TypeAliases.addF64(builder, f64);
  MyGame_Example_TypeAliases.addV8(builder, v8Offset);
  MyGame_Example_TypeAliases.addVf64(builder, vf64Offset);
  return MyGame_Example_TypeAliases.endTypeAliases(builder);
}

serialize():Uint8Array {
  return this.bb!.bytes();
}

static deserialize(buffer: Uint8Array):TypeAliases {
  return MyGame_Example_TypeAliases.getRootAsTypeAliases(new flatbuffers.ByteBuffer(buffer))
}
}

