// 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 CommandRaceVote implements flatbuffers.IUnpackableObject<CommandRaceVoteT> {
  bb: flatbuffers.ByteBuffer|null = null;
  bb_pos = 0;
  __init(i:number, bb:flatbuffers.ByteBuffer):CommandRaceVote {
  this.bb_pos = i;
  this.bb = bb;
  return this;
}

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

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

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

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

static addAcceptor(builder:flatbuffers.Builder, acceptorOffset:flatbuffers.Offset) {
  builder.addFieldOffset(0, acceptorOffset, 0);
}

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

static createCommandRaceVote(builder:flatbuffers.Builder, acceptorOffset:flatbuffers.Offset):flatbuffers.Offset {
  CommandRaceVote.startCommandRaceVote(builder);
  CommandRaceVote.addAcceptor(builder, acceptorOffset);
  return CommandRaceVote.endCommandRaceVote(builder);
}

unpack(): CommandRaceVoteT {
  return new CommandRaceVoteT(
    this.acceptor()
  );
}


unpackTo(_o: CommandRaceVoteT): void {
  _o.acceptor = this.acceptor();
}
}

export class CommandRaceVoteT implements flatbuffers.IGeneratedObject {
constructor(
  public acceptor: string|Uint8Array|null = null
){}


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

  return CommandRaceVote.createCommandRaceVote(builder,
    acceptor
  );
}
}
