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

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

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

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

static startGalaxy(builder:flatbuffers.Builder) {
  builder.startObject(1);
}

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

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

static createGalaxy(builder:flatbuffers.Builder, numStars:bigint):flatbuffers.Offset {
  Galaxy.startGalaxy(builder);
  Galaxy.addNumStars(builder, numStars);
  return Galaxy.endGalaxy(builder);
}
}
