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

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

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

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

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

static startCommandShipGroupBreak(builder:flatbuffers.Builder) {
  builder.startObject(3);
}

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

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

static addQuantity(builder:flatbuffers.Builder, quantity:bigint) {
  builder.addFieldInt64(2, quantity, BigInt('0'));
}

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

static createCommandShipGroupBreak(builder:flatbuffers.Builder, idOffset:flatbuffers.Offset, newIdOffset:flatbuffers.Offset, quantity:bigint):flatbuffers.Offset {
  CommandShipGroupBreak.startCommandShipGroupBreak(builder);
  CommandShipGroupBreak.addId(builder, idOffset);
  CommandShipGroupBreak.addNewId(builder, newIdOffset);
  CommandShipGroupBreak.addQuantity(builder, quantity);
  return CommandShipGroupBreak.endCommandShipGroupBreak(builder);
}

unpack(): CommandShipGroupBreakT {
  return new CommandShipGroupBreakT(
    this.id(),
    this.newId(),
    this.quantity()
  );
}


unpackTo(_o: CommandShipGroupBreakT): void {
  _o.id = this.id();
  _o.newId = this.newId();
  _o.quantity = this.quantity();
}
}

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


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

  return CommandShipGroupBreak.createCommandShipGroupBreak(builder,
    id,
    newId,
    this.quantity
  );
}
}
