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

import * as flatbuffers from 'flatbuffers';

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

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

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

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

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

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

suppressed():boolean {
  const offset = this.bb!.__offset(this.bb_pos, 10);
  return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
}

static startAdsInfo(builder:flatbuffers.Builder) {
  builder.startObject(4);
}

static addCooldownGlobalS(builder:flatbuffers.Builder, cooldownGlobalS:number) {
  builder.addFieldInt32(0, cooldownGlobalS, 0);
}

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

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

static addSuppressed(builder:flatbuffers.Builder, suppressed:boolean) {
  builder.addFieldInt8(3, +suppressed, +false);
}

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

static createAdsInfo(builder:flatbuffers.Builder, cooldownGlobalS:number, cooldownVsAiS:number, cooldownHintS:number, suppressed:boolean):flatbuffers.Offset {
  AdsInfo.startAdsInfo(builder);
  AdsInfo.addCooldownGlobalS(builder, cooldownGlobalS);
  AdsInfo.addCooldownVsAiS(builder, cooldownVsAiS);
  AdsInfo.addCooldownHintS(builder, cooldownHintS);
  AdsInfo.addSuppressed(builder, suppressed);
  return AdsInfo.endAdsInfo(builder);
}
}
