| 1 |
// automatically generated by the FlatBuffers compiler, do not modify |
| 2 |
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ |
| 3 |
import * as flatbuffers from 'flatbuffers'; |
| 4 |
import { TableA } from '../../table-a.js'; |
| 5 |
export class TableB { |
| 6 |
constructor() { |
| 7 |
this.bb = null; |
| 8 |
this.bb_pos = 0; |
| 9 |
} |
| 10 |
__init(i, bb) { |
| 11 |
this.bb_pos = i; |
| 12 |
this.bb = bb; |
| 13 |
return this; |
| 14 |
} |
| 15 |
static getRootAsTableB(bb, obj) { |
| 16 |
return (obj || new TableB()).__init(bb.readInt32(bb.position()) + bb.position(), bb); |
| 17 |
} |
| 18 |
static getSizePrefixedRootAsTableB(bb, obj) { |
| 19 |
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); |
| 20 |
return (obj || new TableB()).__init(bb.readInt32(bb.position()) + bb.position(), bb); |
| 21 |
} |
| 22 |
a(obj) { |
| 23 |
const offset = this.bb.__offset(this.bb_pos, 4); |
| 24 |
return offset ? (obj || new TableA()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null; |
| 25 |
} |
| 26 |
static getFullyQualifiedName() { |
| 27 |
return 'MyGame.OtherNameSpace.TableB'; |
| 28 |
} |
| 29 |
static startTableB(builder) { |
| 30 |
builder.startObject(1); |
| 31 |
} |
| 32 |
static addA(builder, aOffset) { |
| 33 |
builder.addFieldOffset(0, aOffset, 0); |
| 34 |
} |
| 35 |
static endTableB(builder) { |
| 36 |
const offset = builder.endObject(); |
| 37 |
return offset; |
| 38 |
} |
| 39 |
static createTableB(builder, aOffset) { |
| 40 |
TableB.startTableB(builder); |
| 41 |
TableB.addA(builder, aOffset); |
| 42 |
return TableB.endTableB(builder); |
| 43 |
} |
| 44 |
serialize() { |
| 45 |
return this.bb.bytes(); |
| 46 |
} |
| 47 |
static deserialize(buffer) { |
| 48 |
return TableB.getRootAsTableB(new flatbuffers.ByteBuffer(buffer)); |
| 49 |
} |
| 50 |
unpack() { |
| 51 |
return new TableBT((this.a() !== null ? this.a().unpack() : null)); |
| 52 |
} |
| 53 |
unpackTo(_o) { |
| 54 |
_o.a = (this.a() !== null ? this.a().unpack() : null); |
| 55 |
} |
| 56 |
} |
| 57 |
export class TableBT { |
| 58 |
constructor(a = null) { |
| 59 |
this.a = a; |
| 60 |
} |
| 61 |
pack(builder) { |
| 62 |
const a = (this.a !== null ? this.a.pack(builder) : 0); |
| 63 |
return TableB.createTableB(builder, a); |
| 64 |
} |
| 65 |
} |