James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 1 | // automatically generated by the FlatBuffers compiler, do not modify |
| 2 | |
| 3 | import * as flatbuffers from 'flatbuffers'; |
| 4 | |
| 5 | |
| 6 | |
| 7 | export class Rapunzel { |
| 8 | bb: flatbuffers.ByteBuffer|null = null; |
| 9 | bb_pos = 0; |
Austin Schuh | 2dd86a9 | 2022-09-14 21:19:23 -0700 | [diff] [blame^] | 10 | __init(i:number, bb:flatbuffers.ByteBuffer):Rapunzel { |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 11 | this.bb_pos = i; |
| 12 | this.bb = bb; |
| 13 | return this; |
| 14 | } |
| 15 | |
| 16 | hairLength():number { |
| 17 | return this.bb!.readInt32(this.bb_pos); |
| 18 | } |
| 19 | |
| 20 | mutate_hair_length(value:number):boolean { |
| 21 | this.bb!.writeInt32(this.bb_pos + 0, value); |
| 22 | return true; |
| 23 | } |
| 24 | |
| 25 | static getFullyQualifiedName():string { |
| 26 | return 'Rapunzel'; |
| 27 | } |
| 28 | |
| 29 | static sizeOf():number { |
| 30 | return 4; |
| 31 | } |
| 32 | |
| 33 | static createRapunzel(builder:flatbuffers.Builder, hair_length: number):flatbuffers.Offset { |
| 34 | builder.prep(4, 4); |
| 35 | builder.writeInt32(hair_length); |
| 36 | return builder.offset(); |
| 37 | } |
| 38 | |
| 39 | |
| 40 | unpack(): RapunzelT { |
| 41 | return new RapunzelT( |
| 42 | this.hairLength() |
| 43 | ); |
| 44 | } |
| 45 | |
| 46 | |
| 47 | unpackTo(_o: RapunzelT): void { |
| 48 | _o.hairLength = this.hairLength(); |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | export class RapunzelT { |
| 53 | constructor( |
| 54 | public hairLength: number = 0 |
| 55 | ){} |
| 56 | |
| 57 | |
| 58 | pack(builder:flatbuffers.Builder): flatbuffers.Offset { |
| 59 | return Rapunzel.createRapunzel(builder, |
| 60 | this.hairLength |
| 61 | ); |
| 62 | } |
| 63 | } |