// automatically generated by the FlatBuffers compiler, do not modify

import * as flatbuffers from 'flatbuffers';

export class GameLimits {
  bb: flatbuffers.ByteBuffer|null = null;
  bb_pos = 0;
  __init(i:number, bb:flatbuffers.ByteBuffer):GameLimits {
  this.bb_pos = i;
  this.bb = bb;
  return this;
}

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

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

vsAi():number {
  const offset = this.bb!.__offset(this.bb_pos, 4);
  return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
}

random():number {
  const offset = this.bb!.__offset(this.bb_pos, 6);
  return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
}

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

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

static addVsAi(builder:flatbuffers.Builder, vsAi:number) {
  builder.addFieldInt32(0, vsAi, 0);
}

static addRandom(builder:flatbuffers.Builder, random:number) {
  builder.addFieldInt32(1, random, 0);
}

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

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

static createGameLimits(builder:flatbuffers.Builder, vsAi:number, random:number, friends:number):flatbuffers.Offset {
  GameLimits.startGameLimits(builder);
  GameLimits.addVsAi(builder, vsAi);
  GameLimits.addRandom(builder, random);
  GameLimits.addFriends(builder, friends);
  return GameLimits.endGameLimits(builder);
}
}
