| 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 | |
| 5 | import * as flatbuffers from 'flatbuffers'; |
| 6 | |
| 7 | |
| 8 | |
| 9 | export class InnerStruct implements flatbuffers.IUnpackableObject<InnerStructT> { |
| 10 | bb: flatbuffers.ByteBuffer|null = null; |
| 11 | bb_pos = 0; |
| 12 | __init(i:number, bb:flatbuffers.ByteBuffer):InnerStruct { |
| 13 | this.bb_pos = i; |
| 14 | this.bb = bb; |
| 15 | return this; |
| 16 | } |
| 17 | |
| 18 | a():number { |
| 19 | return this.bb!.readFloat64(this.bb_pos); |
| 20 | } |
| 21 | |
| 22 | b(index: number):number|null { |
| 23 | return this.bb!.readUint8(this.bb_pos + 8 + index); |
| 24 | } |
| 25 | |
| 26 | c():number { |
| 27 | return this.bb!.readInt8(this.bb_pos + 21); |
| 28 | } |
| 29 | |
| 30 | dUnderscore():bigint { |
| 31 | return this.bb!.readInt64(this.bb_pos + 24); |
| 32 | } |
| 33 | |
| 34 | static getFullyQualifiedName():string { |
| 35 | return 'MyGame.Example.InnerStruct'; |
| 36 | } |
| 37 | |
| 38 | static sizeOf():number { |
| 39 | return 32; |
| 40 | } |
| 41 | |
| 42 | static createInnerStruct(builder:flatbuffers.Builder, a: number, b: number[]|null, c: number, d_underscore: bigint):flatbuffers.Offset { |
| 43 | builder.prep(8, 32); |
| 44 | builder.writeInt64(BigInt(d_underscore ?? 0)); |
| 45 | builder.pad(2); |
| 46 | builder.writeInt8(c); |
| 47 | |
| 48 | for (let i = 12; i >= 0; --i) { |
| 49 | builder.writeInt8((b?.[i] ?? 0)); |
| 50 | |
| 51 | } |
| 52 | |
| 53 | builder.writeFloat64(a); |
| 54 | return builder.offset(); |
| 55 | } |
| 56 | |
| 57 | |
| 58 | unpack(): InnerStructT { |
| 59 | return new InnerStructT( |
| 60 | this.a(), |
| 61 | this.bb!.createScalarList<number>(this.b.bind(this), 13), |
| 62 | this.c(), |
| 63 | this.dUnderscore() |
| 64 | ); |
| 65 | } |
| 66 | |
| 67 | |
| 68 | unpackTo(_o: InnerStructT): void { |
| 69 | _o.a = this.a(); |
| 70 | _o.b = this.bb!.createScalarList<number>(this.b.bind(this), 13); |
| 71 | _o.c = this.c(); |
| 72 | _o.dUnderscore = this.dUnderscore(); |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | export class InnerStructT implements flatbuffers.IGeneratedObject { |
| 77 | constructor( |
| 78 | public a: number = 0.0, |
| 79 | public b: (number)[] = [], |
| 80 | public c: number = 0, |
| 81 | public dUnderscore: bigint = BigInt('0') |
| 82 | ){} |
| 83 | |
| 84 | |
| 85 | pack(builder:flatbuffers.Builder): flatbuffers.Offset { |
| 86 | return InnerStruct.createInnerStruct(builder, |
| 87 | this.a, |
| 88 | this.b, |
| 89 | this.c, |
| 90 | this.dUnderscore |
| 91 | ); |
| 92 | } |
| 93 | } |