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

import * as flatbuffers from 'flatbuffers';

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

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

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

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

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

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

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

static addVariant(builder:flatbuffers.Builder, variantOffset:flatbuffers.Offset) {
  builder.addFieldOffset(0, variantOffset, 0);
}

static addMultipleWordsPerTurn(builder:flatbuffers.Builder, multipleWordsPerTurn:boolean) {
  builder.addFieldInt8(1, +multipleWordsPerTurn, +false);
}

static addVsAi(builder:flatbuffers.Builder, vsAi:boolean) {
  builder.addFieldInt8(2, +vsAi, +false);
}

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

static createEnqueueRequest(builder:flatbuffers.Builder, variantOffset:flatbuffers.Offset, multipleWordsPerTurn:boolean, vsAi:boolean):flatbuffers.Offset {
  EnqueueRequest.startEnqueueRequest(builder);
  EnqueueRequest.addVariant(builder, variantOffset);
  EnqueueRequest.addMultipleWordsPerTurn(builder, multipleWordsPerTurn);
  EnqueueRequest.addVsAi(builder, vsAi);
  return EnqueueRequest.endEnqueueRequest(builder);
}
}
