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

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

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

id():string|null
id(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
id(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 startCommandShipGroupSend(builder:flatbuffers.Builder) {
  builder.startObject(2);
}

static addId(builder:flatbuffers.Builder, idOffset:flatbuffers.Offset) {
  builder.addFieldOffset(0, idOffset, 0);
}

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

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

static createCommandShipGroupSend(builder:flatbuffers.Builder, idOffset:flatbuffers.Offset, destination:bigint):flatbuffers.Offset {
  CommandShipGroupSend.startCommandShipGroupSend(builder);
  CommandShipGroupSend.addId(builder, idOffset);
  CommandShipGroupSend.addDestination(builder, destination);
  return CommandShipGroupSend.endCommandShipGroupSend(builder);
}

unpack(): CommandShipGroupSendT {
  return new CommandShipGroupSendT(
    this.id(),
    this.destination()
  );
}


unpackTo(_o: CommandShipGroupSendT): void {
  _o.id = this.id();
  _o.destination = this.destination();
}
}

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


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

  return CommandShipGroupSend.createCommandShipGroupSend(builder,
    id,
    this.destination
  );
}
}
