Debian Codegraph @

tests/ts/my-game/example/ability.ts

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