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

import * as flatbuffers from 'flatbuffers';

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

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

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

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

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

static addOk(builder:flatbuffers.Builder, ok:boolean) {
  builder.addFieldInt8(0, +ok, +false);
}

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

static createAck(builder:flatbuffers.Builder, ok:boolean):flatbuffers.Offset {
  Ack.startAck(builder);
  Ack.addOk(builder, ok);
  return Ack.endAck(builder);
}
}
