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

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

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

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

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

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

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

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

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

static createCommandFleetSend(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset, destination:bigint):flatbuffers.Offset {
  CommandFleetSend.startCommandFleetSend(builder);
  CommandFleetSend.addName(builder, nameOffset);
  CommandFleetSend.addDestination(builder, destination);
  return CommandFleetSend.endCommandFleetSend(builder);
}

unpack(): CommandFleetSendT {
  return new CommandFleetSendT(
    this.name(),
    this.destination()
  );
}


unpackTo(_o: CommandFleetSendT): void {
  _o.name = this.name();
  _o.destination = this.destination();
}
}

export class CommandFleetSendT implements flatbuffers.IGeneratedObject {
constructor(
  public name: string|Uint8Array|null = null,
  public destination: bigint = BigInt('0')
){}


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

  return CommandFleetSend.createCommandFleetSend(builder,
    name,
    this.destination
  );
}
}
