// 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';

import { BattleSummary, BattleSummaryT } from '../report/battle-summary.js';
import { Bombing, BombingT } from '../report/bombing.js';
import { IncomingGroup, IncomingGroupT } from '../report/incoming-group.js';
import { LocalFleet, LocalFleetT } from '../report/local-fleet.js';
import { LocalGroup, LocalGroupT } from '../report/local-group.js';
import { LocalPlanet, LocalPlanetT } from '../report/local-planet.js';
import { OtherGroup, OtherGroupT } from '../report/other-group.js';
import { OtherPlanet, OtherPlanetT } from '../report/other-planet.js';
import { OtherScience, OtherScienceT } from '../report/other-science.js';
import { OthersShipClass, OthersShipClassT } from '../report/others-ship-class.js';
import { Player, PlayerT } from '../report/player.js';
import { Route, RouteT } from '../report/route.js';
import { Science, ScienceT } from '../report/science.js';
import { ShipClass, ShipClassT } from '../report/ship-class.js';
import { ShipProduction, ShipProductionT } from '../report/ship-production.js';
import { UnidentifiedGroup, UnidentifiedGroupT } from '../report/unidentified-group.js';
import { UnidentifiedPlanet, UnidentifiedPlanetT } from '../report/unidentified-planet.js';
import { UninhabitedPlanet, UninhabitedPlanetT } from '../report/uninhabited-planet.js';


export class Report implements flatbuffers.IUnpackableObject<ReportT> {
  bb: flatbuffers.ByteBuffer|null = null;
  bb_pos = 0;
  __init(i:number, bb:flatbuffers.ByteBuffer):Report {
  this.bb_pos = i;
  this.bb = bb;
  return this;
}

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

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

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

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

width():number {
  const offset = this.bb!.__offset(this.bb_pos, 8);
  return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;
}

height():number {
  const offset = this.bb!.__offset(this.bb_pos, 10);
  return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;
}

planetCount():number {
  const offset = this.bb!.__offset(this.bb_pos, 12);
  return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;
}

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

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

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

player(index: number, obj?:Player):Player|null {
  const offset = this.bb!.__offset(this.bb_pos, 20);
  return offset ? (obj || new Player()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
}

playerLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 20);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

localScience(index: number, obj?:Science):Science|null {
  const offset = this.bb!.__offset(this.bb_pos, 22);
  return offset ? (obj || new Science()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
}

localScienceLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 22);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

otherScience(index: number, obj?:OtherScience):OtherScience|null {
  const offset = this.bb!.__offset(this.bb_pos, 24);
  return offset ? (obj || new OtherScience()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
}

otherScienceLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 24);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

localShipClass(index: number, obj?:ShipClass):ShipClass|null {
  const offset = this.bb!.__offset(this.bb_pos, 26);
  return offset ? (obj || new ShipClass()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
}

localShipClassLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 26);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

otherShipClass(index: number, obj?:OthersShipClass):OthersShipClass|null {
  const offset = this.bb!.__offset(this.bb_pos, 28);
  return offset ? (obj || new OthersShipClass()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
}

otherShipClassLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 28);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

battle(index: number, obj?:BattleSummary):BattleSummary|null {
  const offset = this.bb!.__offset(this.bb_pos, 30);
  return offset ? (obj || new BattleSummary()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
}

battleLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 30);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

bombing(index: number, obj?:Bombing):Bombing|null {
  const offset = this.bb!.__offset(this.bb_pos, 32);
  return offset ? (obj || new Bombing()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
}

bombingLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 32);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

incomingGroup(index: number, obj?:IncomingGroup):IncomingGroup|null {
  const offset = this.bb!.__offset(this.bb_pos, 34);
  return offset ? (obj || new IncomingGroup()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
}

incomingGroupLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 34);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

localPlanet(index: number, obj?:LocalPlanet):LocalPlanet|null {
  const offset = this.bb!.__offset(this.bb_pos, 36);
  return offset ? (obj || new LocalPlanet()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
}

localPlanetLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 36);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

shipProduction(index: number, obj?:ShipProduction):ShipProduction|null {
  const offset = this.bb!.__offset(this.bb_pos, 38);
  return offset ? (obj || new ShipProduction()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
}

shipProductionLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 38);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

route(index: number, obj?:Route):Route|null {
  const offset = this.bb!.__offset(this.bb_pos, 40);
  return offset ? (obj || new Route()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
}

routeLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 40);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

otherPlanet(index: number, obj?:OtherPlanet):OtherPlanet|null {
  const offset = this.bb!.__offset(this.bb_pos, 42);
  return offset ? (obj || new OtherPlanet()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
}

otherPlanetLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 42);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

uninhabitedPlanet(index: number, obj?:UninhabitedPlanet):UninhabitedPlanet|null {
  const offset = this.bb!.__offset(this.bb_pos, 44);
  return offset ? (obj || new UninhabitedPlanet()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
}

uninhabitedPlanetLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 44);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

unidentifiedPlanet(index: number, obj?:UnidentifiedPlanet):UnidentifiedPlanet|null {
  const offset = this.bb!.__offset(this.bb_pos, 46);
  return offset ? (obj || new UnidentifiedPlanet()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
}

unidentifiedPlanetLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 46);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

localFleet(index: number, obj?:LocalFleet):LocalFleet|null {
  const offset = this.bb!.__offset(this.bb_pos, 48);
  return offset ? (obj || new LocalFleet()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
}

localFleetLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 48);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

localGroup(index: number, obj?:LocalGroup):LocalGroup|null {
  const offset = this.bb!.__offset(this.bb_pos, 50);
  return offset ? (obj || new LocalGroup()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
}

localGroupLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 50);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

otherGroup(index: number, obj?:OtherGroup):OtherGroup|null {
  const offset = this.bb!.__offset(this.bb_pos, 52);
  return offset ? (obj || new OtherGroup()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
}

otherGroupLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 52);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

unidentifiedGroup(index: number, obj?:UnidentifiedGroup):UnidentifiedGroup|null {
  const offset = this.bb!.__offset(this.bb_pos, 54);
  return offset ? (obj || new UnidentifiedGroup()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
}

unidentifiedGroupLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 54);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

static startReport(builder:flatbuffers.Builder) {
  builder.startObject(26);
}

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

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

static addWidth(builder:flatbuffers.Builder, width:number) {
  builder.addFieldInt32(2, width, 0);
}

static addHeight(builder:flatbuffers.Builder, height:number) {
  builder.addFieldInt32(3, height, 0);
}

static addPlanetCount(builder:flatbuffers.Builder, planetCount:number) {
  builder.addFieldInt32(4, planetCount, 0);
}

static addRace(builder:flatbuffers.Builder, raceOffset:flatbuffers.Offset) {
  builder.addFieldOffset(5, raceOffset, 0);
}

static addVotes(builder:flatbuffers.Builder, votes:number) {
  builder.addFieldFloat32(6, votes, 0.0);
}

static addVoteFor(builder:flatbuffers.Builder, voteForOffset:flatbuffers.Offset) {
  builder.addFieldOffset(7, voteForOffset, 0);
}

static addPlayer(builder:flatbuffers.Builder, playerOffset:flatbuffers.Offset) {
  builder.addFieldOffset(8, playerOffset, 0);
}

static createPlayerVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
  builder.startVector(4, data.length, 4);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addOffset(data[i]!);
  }
  return builder.endVector();
}

static startPlayerVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(4, numElems, 4);
}

static addLocalScience(builder:flatbuffers.Builder, localScienceOffset:flatbuffers.Offset) {
  builder.addFieldOffset(9, localScienceOffset, 0);
}

static createLocalScienceVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
  builder.startVector(4, data.length, 4);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addOffset(data[i]!);
  }
  return builder.endVector();
}

static startLocalScienceVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(4, numElems, 4);
}

static addOtherScience(builder:flatbuffers.Builder, otherScienceOffset:flatbuffers.Offset) {
  builder.addFieldOffset(10, otherScienceOffset, 0);
}

static createOtherScienceVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
  builder.startVector(4, data.length, 4);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addOffset(data[i]!);
  }
  return builder.endVector();
}

static startOtherScienceVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(4, numElems, 4);
}

static addLocalShipClass(builder:flatbuffers.Builder, localShipClassOffset:flatbuffers.Offset) {
  builder.addFieldOffset(11, localShipClassOffset, 0);
}

static createLocalShipClassVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
  builder.startVector(4, data.length, 4);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addOffset(data[i]!);
  }
  return builder.endVector();
}

static startLocalShipClassVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(4, numElems, 4);
}

static addOtherShipClass(builder:flatbuffers.Builder, otherShipClassOffset:flatbuffers.Offset) {
  builder.addFieldOffset(12, otherShipClassOffset, 0);
}

static createOtherShipClassVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
  builder.startVector(4, data.length, 4);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addOffset(data[i]!);
  }
  return builder.endVector();
}

static startOtherShipClassVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(4, numElems, 4);
}

static addBattle(builder:flatbuffers.Builder, battleOffset:flatbuffers.Offset) {
  builder.addFieldOffset(13, battleOffset, 0);
}

static createBattleVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
  builder.startVector(4, data.length, 4);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addOffset(data[i]!);
  }
  return builder.endVector();
}

static startBattleVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(4, numElems, 4);
}

static addBombing(builder:flatbuffers.Builder, bombingOffset:flatbuffers.Offset) {
  builder.addFieldOffset(14, bombingOffset, 0);
}

static createBombingVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
  builder.startVector(4, data.length, 4);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addOffset(data[i]!);
  }
  return builder.endVector();
}

static startBombingVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(4, numElems, 4);
}

static addIncomingGroup(builder:flatbuffers.Builder, incomingGroupOffset:flatbuffers.Offset) {
  builder.addFieldOffset(15, incomingGroupOffset, 0);
}

static createIncomingGroupVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
  builder.startVector(4, data.length, 4);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addOffset(data[i]!);
  }
  return builder.endVector();
}

static startIncomingGroupVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(4, numElems, 4);
}

static addLocalPlanet(builder:flatbuffers.Builder, localPlanetOffset:flatbuffers.Offset) {
  builder.addFieldOffset(16, localPlanetOffset, 0);
}

static createLocalPlanetVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
  builder.startVector(4, data.length, 4);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addOffset(data[i]!);
  }
  return builder.endVector();
}

static startLocalPlanetVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(4, numElems, 4);
}

static addShipProduction(builder:flatbuffers.Builder, shipProductionOffset:flatbuffers.Offset) {
  builder.addFieldOffset(17, shipProductionOffset, 0);
}

static createShipProductionVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
  builder.startVector(4, data.length, 4);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addOffset(data[i]!);
  }
  return builder.endVector();
}

static startShipProductionVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(4, numElems, 4);
}

static addRoute(builder:flatbuffers.Builder, routeOffset:flatbuffers.Offset) {
  builder.addFieldOffset(18, routeOffset, 0);
}

static createRouteVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
  builder.startVector(4, data.length, 4);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addOffset(data[i]!);
  }
  return builder.endVector();
}

static startRouteVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(4, numElems, 4);
}

static addOtherPlanet(builder:flatbuffers.Builder, otherPlanetOffset:flatbuffers.Offset) {
  builder.addFieldOffset(19, otherPlanetOffset, 0);
}

static createOtherPlanetVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
  builder.startVector(4, data.length, 4);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addOffset(data[i]!);
  }
  return builder.endVector();
}

static startOtherPlanetVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(4, numElems, 4);
}

static addUninhabitedPlanet(builder:flatbuffers.Builder, uninhabitedPlanetOffset:flatbuffers.Offset) {
  builder.addFieldOffset(20, uninhabitedPlanetOffset, 0);
}

static createUninhabitedPlanetVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
  builder.startVector(4, data.length, 4);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addOffset(data[i]!);
  }
  return builder.endVector();
}

static startUninhabitedPlanetVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(4, numElems, 4);
}

static addUnidentifiedPlanet(builder:flatbuffers.Builder, unidentifiedPlanetOffset:flatbuffers.Offset) {
  builder.addFieldOffset(21, unidentifiedPlanetOffset, 0);
}

static createUnidentifiedPlanetVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
  builder.startVector(4, data.length, 4);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addOffset(data[i]!);
  }
  return builder.endVector();
}

static startUnidentifiedPlanetVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(4, numElems, 4);
}

static addLocalFleet(builder:flatbuffers.Builder, localFleetOffset:flatbuffers.Offset) {
  builder.addFieldOffset(22, localFleetOffset, 0);
}

static createLocalFleetVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
  builder.startVector(4, data.length, 4);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addOffset(data[i]!);
  }
  return builder.endVector();
}

static startLocalFleetVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(4, numElems, 4);
}

static addLocalGroup(builder:flatbuffers.Builder, localGroupOffset:flatbuffers.Offset) {
  builder.addFieldOffset(23, localGroupOffset, 0);
}

static createLocalGroupVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
  builder.startVector(4, data.length, 4);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addOffset(data[i]!);
  }
  return builder.endVector();
}

static startLocalGroupVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(4, numElems, 4);
}

static addOtherGroup(builder:flatbuffers.Builder, otherGroupOffset:flatbuffers.Offset) {
  builder.addFieldOffset(24, otherGroupOffset, 0);
}

static createOtherGroupVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
  builder.startVector(4, data.length, 4);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addOffset(data[i]!);
  }
  return builder.endVector();
}

static startOtherGroupVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(4, numElems, 4);
}

static addUnidentifiedGroup(builder:flatbuffers.Builder, unidentifiedGroupOffset:flatbuffers.Offset) {
  builder.addFieldOffset(25, unidentifiedGroupOffset, 0);
}

static createUnidentifiedGroupVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
  builder.startVector(4, data.length, 4);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addOffset(data[i]!);
  }
  return builder.endVector();
}

static startUnidentifiedGroupVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(4, numElems, 4);
}

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

static finishReportBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) {
  builder.finish(offset);
}

static finishSizePrefixedReportBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) {
  builder.finish(offset, undefined, true);
}

static createReport(builder:flatbuffers.Builder, version:bigint, turn:bigint, width:number, height:number, planetCount:number, raceOffset:flatbuffers.Offset, votes:number, voteForOffset:flatbuffers.Offset, playerOffset:flatbuffers.Offset, localScienceOffset:flatbuffers.Offset, otherScienceOffset:flatbuffers.Offset, localShipClassOffset:flatbuffers.Offset, otherShipClassOffset:flatbuffers.Offset, battleOffset:flatbuffers.Offset, bombingOffset:flatbuffers.Offset, incomingGroupOffset:flatbuffers.Offset, localPlanetOffset:flatbuffers.Offset, shipProductionOffset:flatbuffers.Offset, routeOffset:flatbuffers.Offset, otherPlanetOffset:flatbuffers.Offset, uninhabitedPlanetOffset:flatbuffers.Offset, unidentifiedPlanetOffset:flatbuffers.Offset, localFleetOffset:flatbuffers.Offset, localGroupOffset:flatbuffers.Offset, otherGroupOffset:flatbuffers.Offset, unidentifiedGroupOffset:flatbuffers.Offset):flatbuffers.Offset {
  Report.startReport(builder);
  Report.addVersion(builder, version);
  Report.addTurn(builder, turn);
  Report.addWidth(builder, width);
  Report.addHeight(builder, height);
  Report.addPlanetCount(builder, planetCount);
  Report.addRace(builder, raceOffset);
  Report.addVotes(builder, votes);
  Report.addVoteFor(builder, voteForOffset);
  Report.addPlayer(builder, playerOffset);
  Report.addLocalScience(builder, localScienceOffset);
  Report.addOtherScience(builder, otherScienceOffset);
  Report.addLocalShipClass(builder, localShipClassOffset);
  Report.addOtherShipClass(builder, otherShipClassOffset);
  Report.addBattle(builder, battleOffset);
  Report.addBombing(builder, bombingOffset);
  Report.addIncomingGroup(builder, incomingGroupOffset);
  Report.addLocalPlanet(builder, localPlanetOffset);
  Report.addShipProduction(builder, shipProductionOffset);
  Report.addRoute(builder, routeOffset);
  Report.addOtherPlanet(builder, otherPlanetOffset);
  Report.addUninhabitedPlanet(builder, uninhabitedPlanetOffset);
  Report.addUnidentifiedPlanet(builder, unidentifiedPlanetOffset);
  Report.addLocalFleet(builder, localFleetOffset);
  Report.addLocalGroup(builder, localGroupOffset);
  Report.addOtherGroup(builder, otherGroupOffset);
  Report.addUnidentifiedGroup(builder, unidentifiedGroupOffset);
  return Report.endReport(builder);
}

unpack(): ReportT {
  return new ReportT(
    this.version(),
    this.turn(),
    this.width(),
    this.height(),
    this.planetCount(),
    this.race(),
    this.votes(),
    this.voteFor(),
    this.bb!.createObjList<Player, PlayerT>(this.player.bind(this), this.playerLength()),
    this.bb!.createObjList<Science, ScienceT>(this.localScience.bind(this), this.localScienceLength()),
    this.bb!.createObjList<OtherScience, OtherScienceT>(this.otherScience.bind(this), this.otherScienceLength()),
    this.bb!.createObjList<ShipClass, ShipClassT>(this.localShipClass.bind(this), this.localShipClassLength()),
    this.bb!.createObjList<OthersShipClass, OthersShipClassT>(this.otherShipClass.bind(this), this.otherShipClassLength()),
    this.bb!.createObjList<BattleSummary, BattleSummaryT>(this.battle.bind(this), this.battleLength()),
    this.bb!.createObjList<Bombing, BombingT>(this.bombing.bind(this), this.bombingLength()),
    this.bb!.createObjList<IncomingGroup, IncomingGroupT>(this.incomingGroup.bind(this), this.incomingGroupLength()),
    this.bb!.createObjList<LocalPlanet, LocalPlanetT>(this.localPlanet.bind(this), this.localPlanetLength()),
    this.bb!.createObjList<ShipProduction, ShipProductionT>(this.shipProduction.bind(this), this.shipProductionLength()),
    this.bb!.createObjList<Route, RouteT>(this.route.bind(this), this.routeLength()),
    this.bb!.createObjList<OtherPlanet, OtherPlanetT>(this.otherPlanet.bind(this), this.otherPlanetLength()),
    this.bb!.createObjList<UninhabitedPlanet, UninhabitedPlanetT>(this.uninhabitedPlanet.bind(this), this.uninhabitedPlanetLength()),
    this.bb!.createObjList<UnidentifiedPlanet, UnidentifiedPlanetT>(this.unidentifiedPlanet.bind(this), this.unidentifiedPlanetLength()),
    this.bb!.createObjList<LocalFleet, LocalFleetT>(this.localFleet.bind(this), this.localFleetLength()),
    this.bb!.createObjList<LocalGroup, LocalGroupT>(this.localGroup.bind(this), this.localGroupLength()),
    this.bb!.createObjList<OtherGroup, OtherGroupT>(this.otherGroup.bind(this), this.otherGroupLength()),
    this.bb!.createObjList<UnidentifiedGroup, UnidentifiedGroupT>(this.unidentifiedGroup.bind(this), this.unidentifiedGroupLength())
  );
}


unpackTo(_o: ReportT): void {
  _o.version = this.version();
  _o.turn = this.turn();
  _o.width = this.width();
  _o.height = this.height();
  _o.planetCount = this.planetCount();
  _o.race = this.race();
  _o.votes = this.votes();
  _o.voteFor = this.voteFor();
  _o.player = this.bb!.createObjList<Player, PlayerT>(this.player.bind(this), this.playerLength());
  _o.localScience = this.bb!.createObjList<Science, ScienceT>(this.localScience.bind(this), this.localScienceLength());
  _o.otherScience = this.bb!.createObjList<OtherScience, OtherScienceT>(this.otherScience.bind(this), this.otherScienceLength());
  _o.localShipClass = this.bb!.createObjList<ShipClass, ShipClassT>(this.localShipClass.bind(this), this.localShipClassLength());
  _o.otherShipClass = this.bb!.createObjList<OthersShipClass, OthersShipClassT>(this.otherShipClass.bind(this), this.otherShipClassLength());
  _o.battle = this.bb!.createObjList<BattleSummary, BattleSummaryT>(this.battle.bind(this), this.battleLength());
  _o.bombing = this.bb!.createObjList<Bombing, BombingT>(this.bombing.bind(this), this.bombingLength());
  _o.incomingGroup = this.bb!.createObjList<IncomingGroup, IncomingGroupT>(this.incomingGroup.bind(this), this.incomingGroupLength());
  _o.localPlanet = this.bb!.createObjList<LocalPlanet, LocalPlanetT>(this.localPlanet.bind(this), this.localPlanetLength());
  _o.shipProduction = this.bb!.createObjList<ShipProduction, ShipProductionT>(this.shipProduction.bind(this), this.shipProductionLength());
  _o.route = this.bb!.createObjList<Route, RouteT>(this.route.bind(this), this.routeLength());
  _o.otherPlanet = this.bb!.createObjList<OtherPlanet, OtherPlanetT>(this.otherPlanet.bind(this), this.otherPlanetLength());
  _o.uninhabitedPlanet = this.bb!.createObjList<UninhabitedPlanet, UninhabitedPlanetT>(this.uninhabitedPlanet.bind(this), this.uninhabitedPlanetLength());
  _o.unidentifiedPlanet = this.bb!.createObjList<UnidentifiedPlanet, UnidentifiedPlanetT>(this.unidentifiedPlanet.bind(this), this.unidentifiedPlanetLength());
  _o.localFleet = this.bb!.createObjList<LocalFleet, LocalFleetT>(this.localFleet.bind(this), this.localFleetLength());
  _o.localGroup = this.bb!.createObjList<LocalGroup, LocalGroupT>(this.localGroup.bind(this), this.localGroupLength());
  _o.otherGroup = this.bb!.createObjList<OtherGroup, OtherGroupT>(this.otherGroup.bind(this), this.otherGroupLength());
  _o.unidentifiedGroup = this.bb!.createObjList<UnidentifiedGroup, UnidentifiedGroupT>(this.unidentifiedGroup.bind(this), this.unidentifiedGroupLength());
}
}

export class ReportT implements flatbuffers.IGeneratedObject {
constructor(
  public version: bigint = BigInt('0'),
  public turn: bigint = BigInt('0'),
  public width: number = 0,
  public height: number = 0,
  public planetCount: number = 0,
  public race: string|Uint8Array|null = null,
  public votes: number = 0.0,
  public voteFor: string|Uint8Array|null = null,
  public player: (PlayerT)[] = [],
  public localScience: (ScienceT)[] = [],
  public otherScience: (OtherScienceT)[] = [],
  public localShipClass: (ShipClassT)[] = [],
  public otherShipClass: (OthersShipClassT)[] = [],
  public battle: (BattleSummaryT)[] = [],
  public bombing: (BombingT)[] = [],
  public incomingGroup: (IncomingGroupT)[] = [],
  public localPlanet: (LocalPlanetT)[] = [],
  public shipProduction: (ShipProductionT)[] = [],
  public route: (RouteT)[] = [],
  public otherPlanet: (OtherPlanetT)[] = [],
  public uninhabitedPlanet: (UninhabitedPlanetT)[] = [],
  public unidentifiedPlanet: (UnidentifiedPlanetT)[] = [],
  public localFleet: (LocalFleetT)[] = [],
  public localGroup: (LocalGroupT)[] = [],
  public otherGroup: (OtherGroupT)[] = [],
  public unidentifiedGroup: (UnidentifiedGroupT)[] = []
){}


pack(builder:flatbuffers.Builder): flatbuffers.Offset {
  const race = (this.race !== null ? builder.createString(this.race!) : 0);
  const voteFor = (this.voteFor !== null ? builder.createString(this.voteFor!) : 0);
  const player = Report.createPlayerVector(builder, builder.createObjectOffsetList(this.player));
  const localScience = Report.createLocalScienceVector(builder, builder.createObjectOffsetList(this.localScience));
  const otherScience = Report.createOtherScienceVector(builder, builder.createObjectOffsetList(this.otherScience));
  const localShipClass = Report.createLocalShipClassVector(builder, builder.createObjectOffsetList(this.localShipClass));
  const otherShipClass = Report.createOtherShipClassVector(builder, builder.createObjectOffsetList(this.otherShipClass));
  const battle = Report.createBattleVector(builder, builder.createObjectOffsetList(this.battle));
  const bombing = Report.createBombingVector(builder, builder.createObjectOffsetList(this.bombing));
  const incomingGroup = Report.createIncomingGroupVector(builder, builder.createObjectOffsetList(this.incomingGroup));
  const localPlanet = Report.createLocalPlanetVector(builder, builder.createObjectOffsetList(this.localPlanet));
  const shipProduction = Report.createShipProductionVector(builder, builder.createObjectOffsetList(this.shipProduction));
  const route = Report.createRouteVector(builder, builder.createObjectOffsetList(this.route));
  const otherPlanet = Report.createOtherPlanetVector(builder, builder.createObjectOffsetList(this.otherPlanet));
  const uninhabitedPlanet = Report.createUninhabitedPlanetVector(builder, builder.createObjectOffsetList(this.uninhabitedPlanet));
  const unidentifiedPlanet = Report.createUnidentifiedPlanetVector(builder, builder.createObjectOffsetList(this.unidentifiedPlanet));
  const localFleet = Report.createLocalFleetVector(builder, builder.createObjectOffsetList(this.localFleet));
  const localGroup = Report.createLocalGroupVector(builder, builder.createObjectOffsetList(this.localGroup));
  const otherGroup = Report.createOtherGroupVector(builder, builder.createObjectOffsetList(this.otherGroup));
  const unidentifiedGroup = Report.createUnidentifiedGroupVector(builder, builder.createObjectOffsetList(this.unidentifiedGroup));

  return Report.createReport(builder,
    this.version,
    this.turn,
    this.width,
    this.height,
    this.planetCount,
    race,
    this.votes,
    voteFor,
    player,
    localScience,
    otherScience,
    localShipClass,
    otherShipClass,
    battle,
    bombing,
    incomingGroup,
    localPlanet,
    shipProduction,
    route,
    otherPlanet,
    uninhabitedPlanet,
    unidentifiedPlanet,
    localFleet,
    localGroup,
    otherGroup,
    unidentifiedGroup
  );
}
}
