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 | |
| 6 | |
| 7 | export class Ability { |
| 8 | bb: flatbuffers.ByteBuffer|null = null; |
| 9 | bb_pos = 0; |
| 10 | __init(i:number, bb:flatbuffers.ByteBuffer):Ability { |
| 11 | this.bb_pos = i; |
| 12 | this.bb = bb; |
| 13 | return this; |
| 14 | } |
| 15 | |
| 16 | id():number { |
| 17 | return this.bb!.readUint32(this.bb_pos); |
| 18 | } |
| 19 | |
| 20 | mutate_id(value:number):boolean { |
| 21 | this.bb!.writeUint32(this.bb_pos + 0, value); |
| 22 | return true; |
| 23 | } |
| 24 | |
| 25 | distance():number { |
| 26 | return this.bb!.readUint32(this.bb_pos + 4); |
| 27 | } |
| 28 | |
| 29 | mutate_distance(value:number):boolean { |
| 30 | this.bb!.writeUint32(this.bb_pos + 4, value); |
| 31 | return true; |
| 32 | } |
| 33 | |
| 34 | static getFullyQualifiedName():string { |
| 35 | return 'MyGame_Example_Ability'; |
| 36 | } |
| 37 | |
| 38 | static sizeOf():number { |
| 39 | return 8; |
| 40 | } |
| 41 | |
| 42 | static createAbility(builder:flatbuffers.Builder, id: number, distance: number):flatbuffers.Offset { |
| 43 | builder.prep(4, 8); |
| 44 | builder.writeInt32(distance); |
| 45 | builder.writeInt32(id); |
| 46 | return builder.offset(); |
| 47 | } |
| 48 | |
| 49 | |
| 50 | unpack(): AbilityT { |
| 51 | return new AbilityT( |
| 52 | this.id(), |
| 53 | this.distance() |
| 54 | ); |
| 55 | } |
| 56 | |
| 57 | |
| 58 | unpackTo(_o: AbilityT): void { |
| 59 | _o.id = this.id(); |
| 60 | _o.distance = this.distance(); |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | export class AbilityT { |
| 65 | constructor( |
| 66 | public id: number = 0, |
| 67 | public distance: number = 0 |
| 68 | ){} |
| 69 | |
| 70 | |
| 71 | pack(builder:flatbuffers.Builder): flatbuffers.Offset { |
| 72 | return Ability.createAbility(builder, |
| 73 | this.id, |
| 74 | this.distance |
| 75 | ); |
| 76 | } |
| 77 | } |