Austin Schuh | 2dd86a9 | 2022-09-14 21:19:23 -0700 | [diff] [blame] | 1 | // automatically generated by the FlatBuffers compiler, do not modify |
| 2 | |
| 3 | import * as flatbuffers from 'flatbuffers'; |
| 4 | |
| 5 | import { StructOfStructs, StructOfStructsT } from '../../my-game/example/struct-of-structs.js'; |
| 6 | |
| 7 | |
James Kuszmaul | 3b15b0c | 2022-11-08 14:03:16 -0800 | [diff] [blame^] | 8 | export class StructOfStructsOfStructs implements flatbuffers.IUnpackableObject<StructOfStructsOfStructsT> { |
Austin Schuh | 2dd86a9 | 2022-09-14 21:19:23 -0700 | [diff] [blame] | 9 | bb: flatbuffers.ByteBuffer|null = null; |
| 10 | bb_pos = 0; |
| 11 | __init(i:number, bb:flatbuffers.ByteBuffer):StructOfStructsOfStructs { |
| 12 | this.bb_pos = i; |
| 13 | this.bb = bb; |
| 14 | return this; |
| 15 | } |
| 16 | |
| 17 | a(obj?:StructOfStructs):StructOfStructs|null { |
| 18 | return (obj || new StructOfStructs()).__init(this.bb_pos, this.bb!); |
| 19 | } |
| 20 | |
| 21 | static getFullyQualifiedName():string { |
| 22 | return 'MyGame_Example_StructOfStructsOfStructs'; |
| 23 | } |
| 24 | |
| 25 | static sizeOf():number { |
| 26 | return 20; |
| 27 | } |
| 28 | |
| 29 | static createStructOfStructsOfStructs(builder:flatbuffers.Builder, a_a_id: number, a_a_distance: number, a_b_a: number, a_b_b: number, a_c_id: number, a_c_distance: number):flatbuffers.Offset { |
| 30 | builder.prep(4, 20); |
| 31 | builder.prep(4, 20); |
| 32 | builder.prep(4, 8); |
| 33 | builder.writeInt32(a_c_distance); |
| 34 | builder.writeInt32(a_c_id); |
| 35 | builder.prep(2, 4); |
| 36 | builder.pad(1); |
| 37 | builder.writeInt8(a_b_b); |
| 38 | builder.writeInt16(a_b_a); |
| 39 | builder.prep(4, 8); |
| 40 | builder.writeInt32(a_a_distance); |
| 41 | builder.writeInt32(a_a_id); |
| 42 | return builder.offset(); |
| 43 | } |
| 44 | |
| 45 | |
| 46 | unpack(): StructOfStructsOfStructsT { |
| 47 | return new StructOfStructsOfStructsT( |
| 48 | (this.a() !== null ? this.a()!.unpack() : null) |
| 49 | ); |
| 50 | } |
| 51 | |
| 52 | |
| 53 | unpackTo(_o: StructOfStructsOfStructsT): void { |
| 54 | _o.a = (this.a() !== null ? this.a()!.unpack() : null); |
| 55 | } |
| 56 | } |
| 57 | |
James Kuszmaul | 3b15b0c | 2022-11-08 14:03:16 -0800 | [diff] [blame^] | 58 | export class StructOfStructsOfStructsT implements flatbuffers.IGeneratedObject { |
Austin Schuh | 2dd86a9 | 2022-09-14 21:19:23 -0700 | [diff] [blame] | 59 | constructor( |
| 60 | public a: StructOfStructsT|null = null |
| 61 | ){} |
| 62 | |
| 63 | |
| 64 | pack(builder:flatbuffers.Builder): flatbuffers.Offset { |
| 65 | return StructOfStructsOfStructs.createStructOfStructsOfStructs(builder, |
| 66 | (this.a?.a?.id ?? 0), |
| 67 | (this.a?.a?.distance ?? 0), |
| 68 | (this.a?.b?.a ?? 0), |
| 69 | (this.a?.b?.b ?? 0), |
| 70 | (this.a?.c?.id ?? 0), |
| 71 | (this.a?.c?.distance ?? 0) |
| 72 | ); |
| 73 | } |
| 74 | } |