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

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

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

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

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

static startPublicGamesListRequest(builder:flatbuffers.Builder) {
  builder.startObject(2);
}

static addPage(builder:flatbuffers.Builder, page:number) {
  builder.addFieldInt32(0, page, 0);
}

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

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

static createPublicGamesListRequest(builder:flatbuffers.Builder, page:number, pageSize:number):flatbuffers.Offset {
  PublicGamesListRequest.startPublicGamesListRequest(builder);
  PublicGamesListRequest.addPage(builder, page);
  PublicGamesListRequest.addPageSize(builder, pageSize);
  return PublicGamesListRequest.endPublicGamesListRequest(builder);
}

unpack(): PublicGamesListRequestT {
  return new PublicGamesListRequestT(
    this.page(),
    this.pageSize()
  );
}


unpackTo(_o: PublicGamesListRequestT): void {
  _o.page = this.page();
  _o.pageSize = this.pageSize();
}
}

export class PublicGamesListRequestT implements flatbuffers.IGeneratedObject {
constructor(
  public page: number = 0,
  public pageSize: number = 0
){}


pack(builder:flatbuffers.Builder): flatbuffers.Offset {
  return PublicGamesListRequest.createPublicGamesListRequest(builder,
    this.page,
    this.pageSize
  );
}
}
