1// automatically generated by the FlatBuffers compiler, do not modify 2 3/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ 4 5import * as flatbuffers from 'flatbuffers'; 6 7import { TableB, TableBT } from './my-game/other-name-space/table-b.js'; 8 9 10export class TableA implements flatbuffers.IUnpackableObject<TableAT> { 11 bb: flatbuffers.ByteBuffer|null = null; 12 bb_pos = 0; 13 __init(i:number, bb:flatbuffers.ByteBuffer):TableA { 14 this.bb_pos = i; 15 this.bb = bb; 16 return this; 17} 18 19static getRootAsTableA(bb:flatbuffers.ByteBuffer, obj?:TableA):TableA { 20 return (obj || new TableA()).__init(bb.readInt32(bb.position()) + bb.position(), bb); 21} 22 23static getSizePrefixedRootAsTableA(bb:flatbuffers.ByteBuffer, obj?:TableA):TableA { 24 bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); 25 return (obj || new TableA()).__init(bb.readInt32(bb.position()) + bb.position(), bb); 26} 27 28b(obj?:TableB):TableB|null { 29 const offset = this.bb!.__offset(this.bb_pos, 4); 30 return offset ? (obj || new TableB()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null; 31} 32 33static getFullyQualifiedName():string { 34 return 'TableA'; 35} 36 37static startTableA(builder:flatbuffers.Builder) { 38 builder.startObject(1); 39} 40 41static addB(builder:flatbuffers.Builder, bOffset:flatbuffers.Offset) { 42 builder.addFieldOffset(0, bOffset, 0); 43} 44 45static endTableA(builder:flatbuffers.Builder):flatbuffers.Offset { 46 const offset = builder.endObject(); 47 return offset; 48} 49 50static createTableA(builder:flatbuffers.Builder, bOffset:flatbuffers.Offset):flatbuffers.Offset { 51 TableA.startTableA(builder); 52 TableA.addB(builder, bOffset); 53 return TableA.endTableA(builder); 54} 55 56serialize():Uint8Array { 57 return this.bb!.bytes(); 58} 59 60static deserialize(buffer: Uint8Array):TableA { 61 return TableA.getRootAsTableA(new flatbuffers.ByteBuffer(buffer)) 62} 63 64unpack(): TableAT { 65 return new TableAT( 66 (this.b() !== null ? this.b()!.unpack() : null) 67 ); 68} 69 70 71unpackTo(_o: TableAT): void { 72 _o.b = (this.b() !== null ? this.b()!.unpack() : null); 73} 74} 75 76export class TableAT implements flatbuffers.IGeneratedObject { 77constructor( 78 public b: TableBT|null = null 79){} 80 81 82pack(builder:flatbuffers.Builder): flatbuffers.Offset { 83 const b = (this.b !== null ? this.b!.pack(builder) : 0); 84 85 return TableA.createTableA(builder, 86 b 87 ); 88} 89} 90