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

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

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

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

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

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

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

static createCommandShipClassMerge(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset, targetOffset:flatbuffers.Offset):flatbuffers.Offset {
  CommandShipClassMerge.startCommandShipClassMerge(builder);
  CommandShipClassMerge.addName(builder, nameOffset);
  CommandShipClassMerge.addTarget(builder, targetOffset);
  return CommandShipClassMerge.endCommandShipClassMerge(builder);
}

unpack(): CommandShipClassMergeT {
  return new CommandShipClassMergeT(
    this.name(),
    this.target()
  );
}


unpackTo(_o: CommandShipClassMergeT): void {
  _o.name = this.name();
  _o.target = this.target();
}
}

export class CommandShipClassMergeT implements flatbuffers.IGeneratedObject {
constructor(
  public name: string|Uint8Array|null = null,
  public target: string|Uint8Array|null = null
){}


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

  return CommandShipClassMerge.createCommandShipClassMerge(builder,
    name,
    target
  );
}
}
