Debian Codegraph @

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

raw symbols SCIP
1 // automatically generated by the FlatBuffers compiler, do not modify
2 import * as flatbuffers from 'flatbuffers';
3 export class TypeAliases {
4 constructor() {
5 this.bb = null;
6 this.bb_pos = 0;
7 }
8 __init(i, bb) {
9 this.bb_pos = i;
10 this.bb = bb;
11 return this;
12 }
13 static getRootAsTypeAliases(bb, obj) {
14 return (obj || new TypeAliases()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
15 }
16 static getSizePrefixedRootAsTypeAliases(bb, obj) {
17 bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
18 return (obj || new TypeAliases()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
19 }
20 i8() {
21 const offset = this.bb.__offset(this.bb_pos, 4);
22 return offset ? this.bb.readInt8(this.bb_pos + offset) : 0;
23 }
24 mutate_i8(value) {
25 const offset = this.bb.__offset(this.bb_pos, 4);
26 if (offset === 0) {
27 return false;
28 }
29 this.bb.writeInt8(this.bb_pos + offset, value);
30 return true;
31 }
32 u8() {
33 const offset = this.bb.__offset(this.bb_pos, 6);
34 return offset ? this.bb.readUint8(this.bb_pos + offset) : 0;
35 }
36 mutate_u8(value) {
37 const offset = this.bb.__offset(this.bb_pos, 6);
38 if (offset === 0) {
39 return false;
40 }
41 this.bb.writeUint8(this.bb_pos + offset, value);
42 return true;
43 }
44 i16() {
45 const offset = this.bb.__offset(this.bb_pos, 8);
46 return offset ? this.bb.readInt16(this.bb_pos + offset) : 0;
47 }
48 mutate_i16(value) {
49 const offset = this.bb.__offset(this.bb_pos, 8);
50 if (offset === 0) {
51 return false;
52 }
53 this.bb.writeInt16(this.bb_pos + offset, value);
54 return true;
55 }
56 u16() {
57 const offset = this.bb.__offset(this.bb_pos, 10);
58 return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
59 }
60 mutate_u16(value) {
61 const offset = this.bb.__offset(this.bb_pos, 10);
62 if (offset === 0) {
63 return false;
64 }
65 this.bb.writeUint16(this.bb_pos + offset, value);
66 return true;
67 }
68 i32() {
69 const offset = this.bb.__offset(this.bb_pos, 12);
70 return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
71 }
72 mutate_i32(value) {
73 const offset = this.bb.__offset(this.bb_pos, 12);
74 if (offset === 0) {
75 return false;
76 }
77 this.bb.writeInt32(this.bb_pos + offset, value);
78 return true;
79 }
80 u32() {
81 const offset = this.bb.__offset(this.bb_pos, 14);
82 return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
83 }
84 mutate_u32(value) {
85 const offset = this.bb.__offset(this.bb_pos, 14);
86 if (offset === 0) {
87 return false;
88 }
89 this.bb.writeUint32(this.bb_pos + offset, value);
90 return true;
91 }
92 i64() {
93 const offset = this.bb.__offset(this.bb_pos, 16);
94 return offset ? this.bb.readInt64(this.bb_pos + offset) : BigInt('0');
95 }
96 mutate_i64(value) {
97 const offset = this.bb.__offset(this.bb_pos, 16);
98 if (offset === 0) {
99 return false;
100 }
101 this.bb.writeInt64(this.bb_pos + offset, value);
102 return true;
103 }
104 u64() {
105 const offset = this.bb.__offset(this.bb_pos, 18);
106 return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0');
107 }
108 mutate_u64(value) {
109 const offset = this.bb.__offset(this.bb_pos, 18);
110 if (offset === 0) {
111 return false;
112 }
113 this.bb.writeUint64(this.bb_pos + offset, value);
114 return true;
115 }
116 f32() {
117 const offset = this.bb.__offset(this.bb_pos, 20);
118 return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0.0;
119 }
120 mutate_f32(value) {
121 const offset = this.bb.__offset(this.bb_pos, 20);
122 if (offset === 0) {
123 return false;
124 }
125 this.bb.writeFloat32(this.bb_pos + offset, value);
126 return true;
127 }
128 f64() {
129 const offset = this.bb.__offset(this.bb_pos, 22);
130 return offset ? this.bb.readFloat64(this.bb_pos + offset) : 0.0;
131 }
132 mutate_f64(value) {
133 const offset = this.bb.__offset(this.bb_pos, 22);
134 if (offset === 0) {
135 return false;
136 }
137 this.bb.writeFloat64(this.bb_pos + offset, value);
138 return true;
139 }
140 v8(index) {
141 const offset = this.bb.__offset(this.bb_pos, 24);
142 return offset ? this.bb.readInt8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
143 }
144 v8Length() {
145 const offset = this.bb.__offset(this.bb_pos, 24);
146 return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
147 }
148 v8Array() {
149 const offset = this.bb.__offset(this.bb_pos, 24);
150 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;
151 }
152 vf64(index) {
153 const offset = this.bb.__offset(this.bb_pos, 26);
154 return offset ? this.bb.readFloat64(this.bb.__vector(this.bb_pos + offset) + index * 8) : 0;
155 }
156 vf64Length() {
157 const offset = this.bb.__offset(this.bb_pos, 26);
158 return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
159 }
160 vf64Array() {
161 const offset = this.bb.__offset(this.bb_pos, 26);
162 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;
163 }
164 static getFullyQualifiedName() {
165 return 'MyGame.Example.TypeAliases';
166 }
167 static startTypeAliases(builder) {
168 builder.startObject(12);
169 }
170 static addI8(builder, i8) {
171 builder.addFieldInt8(0, i8, 0);
172 }
173 static addU8(builder, u8) {
174 builder.addFieldInt8(1, u8, 0);
175 }
176 static addI16(builder, i16) {
177 builder.addFieldInt16(2, i16, 0);
178 }
179 static addU16(builder, u16) {
180 builder.addFieldInt16(3, u16, 0);
181 }
182 static addI32(builder, i32) {
183 builder.addFieldInt32(4, i32, 0);
184 }
185 static addU32(builder, u32) {
186 builder.addFieldInt32(5, u32, 0);
187 }
188 static addI64(builder, i64) {
189 builder.addFieldInt64(6, i64, BigInt('0'));
190 }
191 static addU64(builder, u64) {
192 builder.addFieldInt64(7, u64, BigInt('0'));
193 }
194 static addF32(builder, f32) {
195 builder.addFieldFloat32(8, f32, 0.0);
196 }
197 static addF64(builder, f64) {
198 builder.addFieldFloat64(9, f64, 0.0);
199 }
200 static addV8(builder, v8Offset) {
201 builder.addFieldOffset(10, v8Offset, 0);
202 }
203 static createV8Vector(builder, data) {
204 builder.startVector(1, data.length, 1);
205 for (let i = data.length - 1; i >= 0; i--) {
206 builder.addInt8(data[i]);
207 }
208 return builder.endVector();
209 }
210 static startV8Vector(builder, numElems) {
211 builder.startVector(1, numElems, 1);
212 }
213 static addVf64(builder, vf64Offset) {
214 builder.addFieldOffset(11, vf64Offset, 0);
215 }
216 static createVf64Vector(builder, data) {
217 builder.startVector(8, data.length, 8);
218 for (let i = data.length - 1; i >= 0; i--) {
219 builder.addFloat64(data[i]);
220 }
221 return builder.endVector();
222 }
223 static startVf64Vector(builder, numElems) {
224 builder.startVector(8, numElems, 8);
225 }
226 static endTypeAliases(builder) {
227 const offset = builder.endObject();
228 return offset;
229 }
230 static createTypeAliases(builder, i8, u8, i16, u16, i32, u32, i64, u64, f32, f64, v8Offset, vf64Offset) {
231 TypeAliases.startTypeAliases(builder);
232 TypeAliases.addI8(builder, i8);
233 TypeAliases.addU8(builder, u8);
234 TypeAliases.addI16(builder, i16);
235 TypeAliases.addU16(builder, u16);
236 TypeAliases.addI32(builder, i32);
237 TypeAliases.addU32(builder, u32);
238 TypeAliases.addI64(builder, i64);
239 TypeAliases.addU64(builder, u64);
240 TypeAliases.addF32(builder, f32);
241 TypeAliases.addF64(builder, f64);
242 TypeAliases.addV8(builder, v8Offset);
243 TypeAliases.addVf64(builder, vf64Offset);
244 return TypeAliases.endTypeAliases(builder);
245 }
246 serialize() {
247 return this.bb.bytes();
248 }
249 static deserialize(buffer) {
250 return TypeAliases.getRootAsTypeAliases(new flatbuffers.ByteBuffer(buffer));
251 }
252 unpack() {
253 return new TypeAliasesT(this.i8(), this.u8(), this.i16(), this.u16(), this.i32(), this.u32(), this.i64(), this.u64(), this.f32(), this.f64(), this.bb.createScalarList(this.v8.bind(this), this.v8Length()), this.bb.createScalarList(this.vf64.bind(this), this.vf64Length()));
254 }
255 unpackTo(_o) {
256 _o.i8 = this.i8();
257 _o.u8 = this.u8();
258 _o.i16 = this.i16();
259 _o.u16 = this.u16();
260 _o.i32 = this.i32();
261 _o.u32 = this.u32();
262 _o.i64 = this.i64();
263 _o.u64 = this.u64();
264 _o.f32 = this.f32();
265 _o.f64 = this.f64();
266 _o.v8 = this.bb.createScalarList(this.v8.bind(this), this.v8Length());
267 _o.vf64 = this.bb.createScalarList(this.vf64.bind(this), this.vf64Length());
268 }
269 }
270 export class TypeAliasesT {
271 constructor(i8 = 0, u8 = 0, i16 = 0, u16 = 0, i32 = 0, u32 = 0, i64 = BigInt('0'), u64 = BigInt('0'), f32 = 0.0, f64 = 0.0, v8 = [], vf64 = []) {
272 this.i8 = i8;
273 this.u8 = u8;
274 this.i16 = i16;
275 this.u16 = u16;
276 this.i32 = i32;
277 this.u32 = u32;
278 this.i64 = i64;
279 this.u64 = u64;
280 this.f32 = f32;
281 this.f64 = f64;
282 this.v8 = v8;
283 this.vf64 = vf64;
284 }
285 pack(builder) {
286 const v8 = TypeAliases.createV8Vector(builder, this.v8);
287 const vf64 = TypeAliases.createVf64Vector(builder, this.vf64);
288 return TypeAliases.createTypeAliases(builder, this.i8, this.u8, this.i16, this.u16, this.i32, this.u32, this.i64, this.u64, this.f32, this.f64, v8, vf64);
289 }
290 }