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

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

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

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

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

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

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

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

static createCommandShipGroupTransfer(builder:flatbuffers.Builder, idOffset:flatbuffers.Offset, acceptorOffset:flatbuffers.Offset):flatbuffers.Offset {
  CommandShipGroupTransfer.startCommandShipGroupTransfer(builder);
  CommandShipGroupTransfer.addId(builder, idOffset);
  CommandShipGroupTransfer.addAcceptor(builder, acceptorOffset);
  return CommandShipGroupTransfer.endCommandShipGroupTransfer(builder);
}

unpack(): CommandShipGroupTransferT {
  return new CommandShipGroupTransferT(
    this.id(),
    this.acceptor()
  );
}


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

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


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

  return CommandShipGroupTransfer.createCommandShipGroupTransfer(builder,
    id,
    acceptor
  );
}
}
