Debian Codegraph @

tests/ts/my-game/other-name-space/table-b.js

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