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

import * as flatbuffers from 'flatbuffers';

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

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

static getSizePrefixedRootAsYourTurnEvent(bb:flatbuffers.ByteBuffer, obj?:YourTurnEvent):YourTurnEvent {
  bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
  return (obj || new YourTurnEvent()).__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;
}

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

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

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

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

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

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

static startYourTurnEvent(builder:flatbuffers.Builder) {
  builder.startObject(7);
}

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

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

static addOpponentName(builder:flatbuffers.Builder, opponentNameOffset:flatbuffers.Offset) {
  builder.addFieldOffset(2, opponentNameOffset, 0);
}

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

static addLastWord(builder:flatbuffers.Builder, lastWordOffset:flatbuffers.Offset) {
  builder.addFieldOffset(4, lastWordOffset, 0);
}

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

static addMoveCount(builder:flatbuffers.Builder, moveCount:number) {
  builder.addFieldInt32(6, moveCount, 0);
}

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

static createYourTurnEvent(builder:flatbuffers.Builder, gameIdOffset:flatbuffers.Offset, deadlineUnix:bigint, opponentNameOffset:flatbuffers.Offset, lastActionOffset:flatbuffers.Offset, lastWordOffset:flatbuffers.Offset, scoreLineOffset:flatbuffers.Offset, moveCount:number):flatbuffers.Offset {
  YourTurnEvent.startYourTurnEvent(builder);
  YourTurnEvent.addGameId(builder, gameIdOffset);
  YourTurnEvent.addDeadlineUnix(builder, deadlineUnix);
  YourTurnEvent.addOpponentName(builder, opponentNameOffset);
  YourTurnEvent.addLastAction(builder, lastActionOffset);
  YourTurnEvent.addLastWord(builder, lastWordOffset);
  YourTurnEvent.addScoreLine(builder, scoreLineOffset);
  YourTurnEvent.addMoveCount(builder, moveCount);
  return YourTurnEvent.endYourTurnEvent(builder);
}
}
