| 1 |
// automatically generated by the FlatBuffers compiler, do not modify |
| 2 |
import { StructOfStructs } from '../../my-game/example/struct-of-structs.js'; |
| 3 |
export class StructOfStructsOfStructs { |
| 4 |
constructor() { |
| 5 |
this.bb = null; |
| 6 |
this.bb_pos = 0; |
| 7 |
} |
| 8 |
__init(i, bb) { |
| 9 |
this.bb_pos = i; |
| 10 |
this.bb = bb; |
| 11 |
return this; |
| 12 |
} |
| 13 |
a(obj) { |
| 14 |
return (obj || new StructOfStructs()).__init(this.bb_pos, this.bb); |
| 15 |
} |
| 16 |
static getFullyQualifiedName() { |
| 17 |
return 'MyGame.Example.StructOfStructsOfStructs'; |
| 18 |
} |
| 19 |
static sizeOf() { |
| 20 |
return 20; |
| 21 |
} |
| 22 |
static createStructOfStructsOfStructs(builder, a_a_id, a_a_distance, a_b_a, a_b_b, a_c_id, a_c_distance) { |
| 23 |
builder.prep(4, 20); |
| 24 |
builder.prep(4, 20); |
| 25 |
builder.prep(4, 8); |
| 26 |
builder.writeInt32(a_c_distance); |
| 27 |
builder.writeInt32(a_c_id); |
| 28 |
builder.prep(2, 4); |
| 29 |
builder.pad(1); |
| 30 |
builder.writeInt8(a_b_b); |
| 31 |
builder.writeInt16(a_b_a); |
| 32 |
builder.prep(4, 8); |
| 33 |
builder.writeInt32(a_a_distance); |
| 34 |
builder.writeInt32(a_a_id); |
| 35 |
return builder.offset(); |
| 36 |
} |
| 37 |
unpack() { |
| 38 |
return new StructOfStructsOfStructsT((this.a() !== null ? this.a().unpack() : null)); |
| 39 |
} |
| 40 |
unpackTo(_o) { |
| 41 |
_o.a = (this.a() !== null ? this.a().unpack() : null); |
| 42 |
} |
| 43 |
} |
| 44 |
export class StructOfStructsOfStructsT { |
| 45 |
constructor(a = null) { |
| 46 |
this.a = a; |
| 47 |
} |
| 48 |
pack(builder) { |
| 49 |
return StructOfStructsOfStructs.createStructOfStructsOfStructs(builder, (this.a?.a?.id ?? 0), (this.a?.a?.distance ?? 0), (this.a?.b?.a ?? 0), (this.a?.b?.b ?? 0), (this.a?.c?.id ?? 0), (this.a?.c?.distance ?? 0)); |
| 50 |
} |
| 51 |
} |