| 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 Test implements flatbuffers.IUnpackableObject<TestT> { |
| 10 |
bb: flatbuffers.ByteBuffer|null = null; |
| 11 |
bb_pos = 0; |
| 12 |
__init(i:number, bb:flatbuffers.ByteBuffer):Test { |
| 13 |
this.bb_pos = i; |
| 14 |
this.bb = bb; |
| 15 |
return this; |
| 16 |
} |
| 17 |
|
| 18 |
a():number { |
| 19 |
return this.bb!.readInt16(this.bb_pos); |
| 20 |
} |
| 21 |
|
| 22 |
mutate_a(value:number):boolean { |
| 23 |
this.bb!.writeInt16(this.bb_pos + 0, value); |
| 24 |
return true; |
| 25 |
} |
| 26 |
|
| 27 |
b():number { |
| 28 |
return this.bb!.readInt8(this.bb_pos + 2); |
| 29 |
} |
| 30 |
|
| 31 |
mutate_b(value:number):boolean { |
| 32 |
this.bb!.writeInt8(this.bb_pos + 2, value); |
| 33 |
return true; |
| 34 |
} |
| 35 |
|
| 36 |
static getFullyQualifiedName():string { |
| 37 |
return 'MyGame.Example.Test'; |
| 38 |
} |
| 39 |
|
| 40 |
static sizeOf():number { |
| 41 |
return 4; |
| 42 |
} |
| 43 |
|
| 44 |
static createTest(builder:flatbuffers.Builder, a: number, b: number):flatbuffers.Offset { |
| 45 |
builder.prep(2, 4); |
| 46 |
builder.pad(1); |
| 47 |
builder.writeInt8(b); |
| 48 |
builder.writeInt16(a); |
| 49 |
return builder.offset(); |
| 50 |
} |
| 51 |
|
| 52 |
|
| 53 |
unpack(): TestT { |
| 54 |
return new TestT( |
| 55 |
this.a(), |
| 56 |
this.b() |
| 57 |
); |
| 58 |
} |
| 59 |
|
| 60 |
|
| 61 |
unpackTo(_o: TestT): void { |
| 62 |
_o.a = this.a(); |
| 63 |
_o.b = this.b(); |
| 64 |
} |
| 65 |
} |
| 66 |
|
| 67 |
export class TestT implements flatbuffers.IGeneratedObject { |
| 68 |
constructor( |
| 69 |
public a: number = 0, |
| 70 |
public b: number = 0 |
| 71 |
){} |
| 72 |
|
| 73 |
|
| 74 |
pack(builder:flatbuffers.Builder): flatbuffers.Offset { |
| 75 |
return Test.createTest(builder, |
| 76 |
this.a, |
| 77 |
this.b |
| 78 |
); |
| 79 |
} |
| 80 |
} |