Debian Codegraph @

tests/ts/my-game/example/type-aliases.ts

raw symbols SCIP
1 // automatically generated by the FlatBuffers compiler, do not modify
2
3 import * as flatbuffers from 'flatbuffers';
4
5
6
7 export class TypeAliases implements flatbuffers.IUnpackableObject<TypeAliasesT> {
8 bb: flatbuffers.ByteBuffer|null = null;
9 bb_pos = 0;
10 __init(i:number, bb:flatbuffers.ByteBuffer):TypeAliases {
11 this.bb_pos = i;
12 this.bb = bb;
13 return this;
14 }
15
16 static getRootAsTypeAliases(bb:flatbuffers.ByteBuffer, obj?:TypeAliases):TypeAliases {
17 return (obj || new TypeAliases()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
18 }
19
20 static getSizePrefixedRootAsTypeAliases(bb:flatbuffers.ByteBuffer, obj?:TypeAliases):TypeAliases {
21 bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
22 return (obj || new TypeAliases()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
23 }
24
25 i8():number {
26 const offset = this.bb!.__offset(this.bb_pos, 4);
27 return offset ? this.bb!.readInt8(this.bb_pos + offset) : 0;
28 }
29
30 mutate_i8(value:number):boolean {
31 const offset = this.bb!.__offset(this.bb_pos, 4);
32
33 if (offset === 0) {
34 return false;
35 }
36
37 this.bb!.writeInt8(this.bb_pos + offset, value);
38 return true;
39 }
40
41 u8():number {
42 const offset = this.bb!.__offset(this.bb_pos, 6);
43 return offset ? this.bb!.readUint8(this.bb_pos + offset) : 0;
44 }
45
46 mutate_u8(value:number):boolean {
47 const offset = this.bb!.__offset(this.bb_pos, 6);
48
49 if (offset === 0) {
50 return false;
51 }
52
53 this.bb!.writeUint8(this.bb_pos + offset, value);
54 return true;
55 }
56
57 i16():number {
58 const offset = this.bb!.__offset(this.bb_pos, 8);
59 return offset ? this.bb!.readInt16(this.bb_pos + offset) : 0;
60 }
61
62 mutate_i16(value:number):boolean {
63 const offset = this.bb!.__offset(this.bb_pos, 8);
64
65 if (offset === 0) {
66 return false;
67 }
68
69 this.bb!.writeInt16(this.bb_pos + offset, value);
70 return true;
71 }
72
73 u16():number {
74 const offset = this.bb!.__offset(this.bb_pos, 10);
75 return offset ? this.bb!.readUint16(this.bb_pos + offset) : 0;
76 }
77
78 mutate_u16(value:number):boolean {
79 const offset = this.bb!.__offset(this.bb_pos, 10);
80
81 if (offset === 0) {
82 return false;
83 }
84
85 this.bb!.writeUint16(this.bb_pos + offset, value);
86 return true;
87 }
88
89 i32():number {
90 const offset = this.bb!.__offset(this.bb_pos, 12);
91 return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
92 }
93
94 mutate_i32(value:number):boolean {
95 const offset = this.bb!.__offset(this.bb_pos, 12);
96
97 if (offset === 0) {
98 return false;
99 }
100
101 this.bb!.writeInt32(this.bb_pos + offset, value);
102 return true;
103 }
104
105 u32():number {
106 const offset = this.bb!.__offset(this.bb_pos, 14);
107 return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;
108 }
109
110 mutate_u32(value:number):boolean {
111 const offset = this.bb!.__offset(this.bb_pos, 14);
112
113 if (offset === 0) {
114 return false;
115 }
116
117 this.bb!.writeUint32(this.bb_pos + offset, value);
118 return true;
119 }
120
121 i64():bigint {
122 const offset = this.bb!.__offset(this.bb_pos, 16);
123 return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0');
124 }
125
126 mutate_i64(value:bigint):boolean {
127 const offset = this.bb!.__offset(this.bb_pos, 16);
128
129 if (offset === 0) {
130 return false;
131 }
132
133 this.bb!.writeInt64(this.bb_pos + offset, value);
134 return true;
135 }
136
137 u64():bigint {
138 const offset = this.bb!.__offset(this.bb_pos, 18);
139 return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0');
140 }
141
142 mutate_u64(value:bigint):boolean {
143 const offset = this.bb!.__offset(this.bb_pos, 18);
144
145 if (offset === 0) {
146 return false;
147 }
148
149 this.bb!.writeUint64(this.bb_pos + offset, value);
150 return true;
151 }
152
153 f32():number {
154 const offset = this.bb!.__offset(this.bb_pos, 20);
155 return offset ? this.bb!.readFloat32(this.bb_pos + offset) : 0.0;
156 }
157
158 mutate_f32(value:number):boolean {
159 const offset = this.bb!.__offset(this.bb_pos, 20);
160
161 if (offset === 0) {
162 return false;
163 }
164
165 this.bb!.writeFloat32(this.bb_pos + offset, value);
166 return true;
167 }
168
169 f64():number {
170 const offset = this.bb!.__offset(this.bb_pos, 22);
171 return offset ? this.bb!.readFloat64(this.bb_pos + offset) : 0.0;
172 }
173
174 mutate_f64(value:number):boolean {
175 const offset = this.bb!.__offset(this.bb_pos, 22);
176
177 if (offset === 0) {
178 return false;
179 }
180
181 this.bb!.writeFloat64(this.bb_pos + offset, value);
182 return true;
183 }
184
185 v8(index: number):number|null {
186 const offset = this.bb!.__offset(this.bb_pos, 24);
187 return offset ? this.bb!.readInt8(this.bb!.__vector(this.bb_pos + offset) + index) : 0;
188 }
189
190 v8Length():number {
191 const offset = this.bb!.__offset(this.bb_pos, 24);
192 return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
193 }
194
195 v8Array():Int8Array|null {
196 const offset = this.bb!.__offset(this.bb_pos, 24);
197 return offset ? new Int8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
198 }
199
200 vf64(index: number):number|null {
201 const offset = this.bb!.__offset(this.bb_pos, 26);
202 return offset ? this.bb!.readFloat64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : 0;
203 }
204
205 vf64Length():number {
206 const offset = this.bb!.__offset(this.bb_pos, 26);
207 return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
208 }
209
210 vf64Array():Float64Array|null {
211 const offset = this.bb!.__offset(this.bb_pos, 26);
212 return offset ? new Float64Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
213 }
214
215 static getFullyQualifiedName():string {
216 return 'MyGame.Example.TypeAliases';
217 }
218
219 static startTypeAliases(builder:flatbuffers.Builder) {
220 builder.startObject(12);
221 }
222
223 static addI8(builder:flatbuffers.Builder, i8:number) {
224 builder.addFieldInt8(0, i8, 0);
225 }
226
227 static addU8(builder:flatbuffers.Builder, u8:number) {
228 builder.addFieldInt8(1, u8, 0);
229 }
230
231 static addI16(builder:flatbuffers.Builder, i16:number) {
232 builder.addFieldInt16(2, i16, 0);
233 }
234
235 static addU16(builder:flatbuffers.Builder, u16:number) {
236 builder.addFieldInt16(3, u16, 0);
237 }
238
239 static addI32(builder:flatbuffers.Builder, i32:number) {
240 builder.addFieldInt32(4, i32, 0);
241 }
242
243 static addU32(builder:flatbuffers.Builder, u32:number) {
244 builder.addFieldInt32(5, u32, 0);
245 }
246
247 static addI64(builder:flatbuffers.Builder, i64:bigint) {
248 builder.addFieldInt64(6, i64, BigInt('0'));
249 }
250
251 static addU64(builder:flatbuffers.Builder, u64:bigint) {
252 builder.addFieldInt64(7, u64, BigInt('0'));
253 }
254
255 static addF32(builder:flatbuffers.Builder, f32:number) {
256 builder.addFieldFloat32(8, f32, 0.0);
257 }
258
259 static addF64(builder:flatbuffers.Builder, f64:number) {
260 builder.addFieldFloat64(9, f64, 0.0);
261 }
262
263 static addV8(builder:flatbuffers.Builder, v8Offset:flatbuffers.Offset) {
264 builder.addFieldOffset(10, v8Offset, 0);
265 }
266
267 static createV8Vector(builder:flatbuffers.Builder, data:number[]|Int8Array):flatbuffers.Offset;
268 /**
269 * @deprecated This Uint8Array overload will be removed in the future.
270 */
271 static createV8Vector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset;
272 static createV8Vector(builder:flatbuffers.Builder, data:number[]|Int8Array|Uint8Array):flatbuffers.Offset {
273 builder.startVector(1, data.length, 1);
274 for (let i = data.length - 1; i >= 0; i--) {
275 builder.addInt8(data[i]!);
276 }
277 return builder.endVector();
278 }
279
280 static startV8Vector(builder:flatbuffers.Builder, numElems:number) {
281 builder.startVector(1, numElems, 1);
282 }
283
284 static addVf64(builder:flatbuffers.Builder, vf64Offset:flatbuffers.Offset) {
285 builder.addFieldOffset(11, vf64Offset, 0);
286 }
287
288 static createVf64Vector(builder:flatbuffers.Builder, data:number[]|Float64Array):flatbuffers.Offset;
289 /**
290 * @deprecated This Uint8Array overload will be removed in the future.
291 */
292 static createVf64Vector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset;
293 static createVf64Vector(builder:flatbuffers.Builder, data:number[]|Float64Array|Uint8Array):flatbuffers.Offset {
294 builder.startVector(8, data.length, 8);
295 for (let i = data.length - 1; i >= 0; i--) {
296 builder.addFloat64(data[i]!);
297 }
298 return builder.endVector();
299 }
300
301 static startVf64Vector(builder:flatbuffers.Builder, numElems:number) {
302 builder.startVector(8, numElems, 8);
303 }
304
305 static endTypeAliases(builder:flatbuffers.Builder):flatbuffers.Offset {
306 const offset = builder.endObject();
307 return offset;
308 }
309
310 static createTypeAliases(builder:flatbuffers.Builder, i8:number, u8:number, i16:number, u16:number, i32:number, u32:number, i64:bigint, u64:bigint, f32:number, f64:number, v8Offset:flatbuffers.Offset, vf64Offset:flatbuffers.Offset):flatbuffers.Offset {
311 TypeAliases.startTypeAliases(builder);
312 TypeAliases.addI8(builder, i8);
313 TypeAliases.addU8(builder, u8);
314 TypeAliases.addI16(builder, i16);
315 TypeAliases.addU16(builder, u16);
316 TypeAliases.addI32(builder, i32);
317 TypeAliases.addU32(builder, u32);
318 TypeAliases.addI64(builder, i64);
319 TypeAliases.addU64(builder, u64);
320 TypeAliases.addF32(builder, f32);
321 TypeAliases.addF64(builder, f64);
322 TypeAliases.addV8(builder, v8Offset);
323 TypeAliases.addVf64(builder, vf64Offset);
324 return TypeAliases.endTypeAliases(builder);
325 }
326
327 serialize():Uint8Array {
328 return this.bb!.bytes();
329 }
330
331 static deserialize(buffer: Uint8Array):TypeAliases {
332 return TypeAliases.getRootAsTypeAliases(new flatbuffers.ByteBuffer(buffer))
333 }
334
335 unpack(): TypeAliasesT {
336 return new TypeAliasesT(
337 this.i8(),
338 this.u8(),
339 this.i16(),
340 this.u16(),
341 this.i32(),
342 this.u32(),
343 this.i64(),
344 this.u64(),
345 this.f32(),
346 this.f64(),
347 this.bb!.createScalarList<number>(this.v8.bind(this), this.v8Length()),
348 this.bb!.createScalarList<number>(this.vf64.bind(this), this.vf64Length())
349 );
350 }
351
352
353 unpackTo(_o: TypeAliasesT): void {
354 _o.i8 = this.i8();
355 _o.u8 = this.u8();
356 _o.i16 = this.i16();
357 _o.u16 = this.u16();
358 _o.i32 = this.i32();
359 _o.u32 = this.u32();
360 _o.i64 = this.i64();
361 _o.u64 = this.u64();
362 _o.f32 = this.f32();
363 _o.f64 = this.f64();
364 _o.v8 = this.bb!.createScalarList<number>(this.v8.bind(this), this.v8Length());
365 _o.vf64 = this.bb!.createScalarList<number>(this.vf64.bind(this), this.vf64Length());
366 }
367 }
368
369 export class TypeAliasesT implements flatbuffers.IGeneratedObject {
370 constructor(
371 public i8: number = 0,
372 public u8: number = 0,
373 public i16: number = 0,
374 public u16: number = 0,
375 public i32: number = 0,
376 public u32: number = 0,
377 public i64: bigint = BigInt('0'),
378 public u64: bigint = BigInt('0'),
379 public f32: number = 0.0,
380 public f64: number = 0.0,
381 public v8: (number)[] = [],
382 public vf64: (number)[] = []
383 ){}
384
385
386 pack(builder:flatbuffers.Builder): flatbuffers.Offset {
387 const v8 = TypeAliases.createV8Vector(builder, this.v8);
388 const vf64 = TypeAliases.createVf64Vector(builder, this.vf64);
389
390 return TypeAliases.createTypeAliases(builder,
391 this.i8,
392 this.u8,
393 this.i16,
394 this.u16,
395 this.i32,
396 this.u32,
397 this.i64,
398 this.u64,
399 this.f32,
400 this.f64,
401 v8,
402 vf64
403 );
404 }
405 }