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