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

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

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

origin():bigint {
  const offset = this.bb!.__offset(this.bb_pos, 4);
  return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0');
}

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

distance():number {
  const offset = this.bb!.__offset(this.bb_pos, 8);
  return offset ? this.bb!.readFloat32(this.bb_pos + offset) : 0.0;
}

speed():number {
  const offset = this.bb!.__offset(this.bb_pos, 10);
  return offset ? this.bb!.readFloat32(this.bb_pos + offset) : 0.0;
}

mass():number {
  const offset = this.bb!.__offset(this.bb_pos, 12);
  return offset ? this.bb!.readFloat32(this.bb_pos + offset) : 0.0;
}

static startIncomingGroup(builder:flatbuffers.Builder) {
  builder.startObject(5);
}

static addOrigin(builder:flatbuffers.Builder, origin:bigint) {
  builder.addFieldInt64(0, origin, BigInt('0'));
}

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

static addDistance(builder:flatbuffers.Builder, distance:number) {
  builder.addFieldFloat32(2, distance, 0.0);
}

static addSpeed(builder:flatbuffers.Builder, speed:number) {
  builder.addFieldFloat32(3, speed, 0.0);
}

static addMass(builder:flatbuffers.Builder, mass:number) {
  builder.addFieldFloat32(4, mass, 0.0);
}

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

static createIncomingGroup(builder:flatbuffers.Builder, origin:bigint, destination:bigint, distance:number, speed:number, mass:number):flatbuffers.Offset {
  IncomingGroup.startIncomingGroup(builder);
  IncomingGroup.addOrigin(builder, origin);
  IncomingGroup.addDestination(builder, destination);
  IncomingGroup.addDistance(builder, distance);
  IncomingGroup.addSpeed(builder, speed);
  IncomingGroup.addMass(builder, mass);
  return IncomingGroup.endIncomingGroup(builder);
}

unpack(): IncomingGroupT {
  return new IncomingGroupT(
    this.origin(),
    this.destination(),
    this.distance(),
    this.speed(),
    this.mass()
  );
}


unpackTo(_o: IncomingGroupT): void {
  _o.origin = this.origin();
  _o.destination = this.destination();
  _o.distance = this.distance();
  _o.speed = this.speed();
  _o.mass = this.mass();
}
}

export class IncomingGroupT implements flatbuffers.IGeneratedObject {
constructor(
  public origin: bigint = BigInt('0'),
  public destination: bigint = BigInt('0'),
  public distance: number = 0.0,
  public speed: number = 0.0,
  public mass: number = 0.0
){}


pack(builder:flatbuffers.Builder): flatbuffers.Offset {
  return IncomingGroup.createIncomingGroup(builder,
    this.origin,
    this.destination,
    this.distance,
    this.speed,
    this.mass
  );
}
}
