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

/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */

import * as flatbuffers from 'flatbuffers';



export class ApplicationSubmitRequest implements flatbuffers.IUnpackableObject<ApplicationSubmitRequestT> {
  bb: flatbuffers.ByteBuffer|null = null;
  bb_pos = 0;
  __init(i:number, bb:flatbuffers.ByteBuffer):ApplicationSubmitRequest {
  this.bb_pos = i;
  this.bb = bb;
  return this;
}

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

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

gameId():string|null
gameId(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
gameId(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;
}

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

static startApplicationSubmitRequest(builder:flatbuffers.Builder) {
  builder.startObject(2);
}

static addGameId(builder:flatbuffers.Builder, gameIdOffset:flatbuffers.Offset) {
  builder.addFieldOffset(0, gameIdOffset, 0);
}

static addRaceName(builder:flatbuffers.Builder, raceNameOffset:flatbuffers.Offset) {
  builder.addFieldOffset(1, raceNameOffset, 0);
}

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

static createApplicationSubmitRequest(builder:flatbuffers.Builder, gameIdOffset:flatbuffers.Offset, raceNameOffset:flatbuffers.Offset):flatbuffers.Offset {
  ApplicationSubmitRequest.startApplicationSubmitRequest(builder);
  ApplicationSubmitRequest.addGameId(builder, gameIdOffset);
  ApplicationSubmitRequest.addRaceName(builder, raceNameOffset);
  return ApplicationSubmitRequest.endApplicationSubmitRequest(builder);
}

unpack(): ApplicationSubmitRequestT {
  return new ApplicationSubmitRequestT(
    this.gameId(),
    this.raceName()
  );
}


unpackTo(_o: ApplicationSubmitRequestT): void {
  _o.gameId = this.gameId();
  _o.raceName = this.raceName();
}
}

export class ApplicationSubmitRequestT implements flatbuffers.IGeneratedObject {
constructor(
  public gameId: string|Uint8Array|null = null,
  public raceName: string|Uint8Array|null = null
){}


pack(builder:flatbuffers.Builder): flatbuffers.Offset {
  const gameId = (this.gameId !== null ? builder.createString(this.gameId!) : 0);
  const raceName = (this.raceName !== null ? builder.createString(this.raceName!) : 0);

  return ApplicationSubmitRequest.createApplicationSubmitRequest(builder,
    gameId,
    raceName
  );
}
}
