blob: a9e9e812ac83fa4892d62c080343fe1dd60472cd [file] [log] [blame]
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001// automatically generated by the FlatBuffers compiler, do not modify
James Kuszmaul8e62b022022-03-22 09:33:25 -07002// ignore_for_file: unused_import, unused_field, unused_element, unused_local_variable
Austin Schuhe89fa2d2019-08-14 20:24:23 -07003
4library my_game.example;
5
6import 'dart:typed_data' show Uint8List;
7import 'package:flat_buffers/flat_buffers.dart' as fb;
8
9import './monster_test_my_game_generated.dart' as my_game;
10import './monster_test_my_game.example2_generated.dart' as my_game_example2;
11
12/// Composite components of Monster color.
13class Color {
14 final int value;
15 const Color._(this.value);
16
17 factory Color.fromValue(int value) {
James Kuszmaul8e62b022022-03-22 09:33:25 -070018 final result = values[value];
19 if (result == null) {
20 if (value == 0) {
21 return Color._(0);
22 } else {
23 throw StateError('Invalid value $value for bit flag enum Color');
24 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -070025 }
James Kuszmaul8e62b022022-03-22 09:33:25 -070026 return result;
Austin Schuhe89fa2d2019-08-14 20:24:23 -070027 }
28
James Kuszmaul8e62b022022-03-22 09:33:25 -070029 static Color? _createOrNull(int? value) =>
30 value == null ? null : Color.fromValue(value);
31
Austin Schuhe89fa2d2019-08-14 20:24:23 -070032 static bool containsValue(int value) => values.containsKey(value);
33
James Kuszmaul8e62b022022-03-22 09:33:25 -070034 static const Color Red = Color._(1);
Austin Schuhe89fa2d2019-08-14 20:24:23 -070035
36 /// \brief color Green
37 /// Green is bit_flag with value (1u << 1)
James Kuszmaul8e62b022022-03-22 09:33:25 -070038 static const Color Green = Color._(2);
Austin Schuhe89fa2d2019-08-14 20:24:23 -070039
40 /// \brief color Blue (1u << 3)
James Kuszmaul8e62b022022-03-22 09:33:25 -070041 static const Color Blue = Color._(8);
42 static const Map<int, Color> values = {
43 1: Red,
44 2: Green,
45 8: Blue};
Austin Schuhe89fa2d2019-08-14 20:24:23 -070046
James Kuszmaul8e62b022022-03-22 09:33:25 -070047 static const fb.Reader<Color> reader = _ColorReader();
Austin Schuhe89fa2d2019-08-14 20:24:23 -070048
49 @override
50 String toString() {
51 return 'Color{value: $value}';
52 }
53}
54
55class _ColorReader extends fb.Reader<Color> {
56 const _ColorReader();
57
58 @override
59 int get size => 1;
60
61 @override
62 Color read(fb.BufferContext bc, int offset) =>
James Kuszmaul8e62b022022-03-22 09:33:25 -070063 Color.fromValue(const fb.Uint8Reader().read(bc, offset));
Austin Schuhe89fa2d2019-08-14 20:24:23 -070064}
65
Austin Schuh272c6132020-11-14 16:37:52 -080066class Race {
67 final int value;
68 const Race._(this.value);
69
70 factory Race.fromValue(int value) {
James Kuszmaul8e62b022022-03-22 09:33:25 -070071 final result = values[value];
72 if (result == null) {
73 throw StateError('Invalid value $value for bit flag enum Race');
Austin Schuh272c6132020-11-14 16:37:52 -080074 }
James Kuszmaul8e62b022022-03-22 09:33:25 -070075 return result;
Austin Schuh272c6132020-11-14 16:37:52 -080076 }
77
James Kuszmaul8e62b022022-03-22 09:33:25 -070078 static Race? _createOrNull(int? value) =>
79 value == null ? null : Race.fromValue(value);
80
Austin Schuh272c6132020-11-14 16:37:52 -080081 static const int minValue = -1;
82 static const int maxValue = 2;
83 static bool containsValue(int value) => values.containsKey(value);
84
James Kuszmaul8e62b022022-03-22 09:33:25 -070085 static const Race None = Race._(-1);
86 static const Race Human = Race._(0);
87 static const Race Dwarf = Race._(1);
88 static const Race Elf = Race._(2);
89 static const Map<int, Race> values = {
90 -1: None,
91 0: Human,
92 1: Dwarf,
93 2: Elf};
Austin Schuh272c6132020-11-14 16:37:52 -080094
James Kuszmaul8e62b022022-03-22 09:33:25 -070095 static const fb.Reader<Race> reader = _RaceReader();
Austin Schuh272c6132020-11-14 16:37:52 -080096
97 @override
98 String toString() {
99 return 'Race{value: $value}';
100 }
101}
102
103class _RaceReader extends fb.Reader<Race> {
104 const _RaceReader();
105
106 @override
107 int get size => 1;
108
109 @override
110 Race read(fb.BufferContext bc, int offset) =>
James Kuszmaul8e62b022022-03-22 09:33:25 -0700111 Race.fromValue(const fb.Int8Reader().read(bc, offset));
112}
113
114class LongEnum {
115 final int value;
116 const LongEnum._(this.value);
117
118 factory LongEnum.fromValue(int value) {
119 final result = values[value];
120 if (result == null) {
121 if (value == 0) {
122 return LongEnum._(0);
123 } else {
124 throw StateError('Invalid value $value for bit flag enum LongEnum');
125 }
126 }
127 return result;
128 }
129
130 static LongEnum? _createOrNull(int? value) =>
131 value == null ? null : LongEnum.fromValue(value);
132
133 static bool containsValue(int value) => values.containsKey(value);
134
135 static const LongEnum LongOne = LongEnum._(2);
136 static const LongEnum LongTwo = LongEnum._(4);
137 static const LongEnum LongBig = LongEnum._(1099511627776);
138 static const Map<int, LongEnum> values = {
139 2: LongOne,
140 4: LongTwo,
141 1099511627776: LongBig};
142
143 static const fb.Reader<LongEnum> reader = _LongEnumReader();
144
145 @override
146 String toString() {
147 return 'LongEnum{value: $value}';
148 }
149}
150
151class _LongEnumReader extends fb.Reader<LongEnum> {
152 const _LongEnumReader();
153
154 @override
Austin Schuh2dd86a92022-09-14 21:19:23 -0700155 int get size => 8;
James Kuszmaul8e62b022022-03-22 09:33:25 -0700156
157 @override
158 LongEnum read(fb.BufferContext bc, int offset) =>
159 LongEnum.fromValue(const fb.Uint64Reader().read(bc, offset));
Austin Schuh272c6132020-11-14 16:37:52 -0800160}
161
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700162class AnyTypeId {
163 final int value;
164 const AnyTypeId._(this.value);
165
166 factory AnyTypeId.fromValue(int value) {
James Kuszmaul8e62b022022-03-22 09:33:25 -0700167 final result = values[value];
168 if (result == null) {
169 throw StateError('Invalid value $value for bit flag enum AnyTypeId');
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700170 }
James Kuszmaul8e62b022022-03-22 09:33:25 -0700171 return result;
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700172 }
173
James Kuszmaul8e62b022022-03-22 09:33:25 -0700174 static AnyTypeId? _createOrNull(int? value) =>
175 value == null ? null : AnyTypeId.fromValue(value);
176
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700177 static const int minValue = 0;
178 static const int maxValue = 3;
179 static bool containsValue(int value) => values.containsKey(value);
180
James Kuszmaul8e62b022022-03-22 09:33:25 -0700181 static const AnyTypeId NONE = AnyTypeId._(0);
182 static const AnyTypeId Monster = AnyTypeId._(1);
183 static const AnyTypeId TestSimpleTableWithEnum = AnyTypeId._(2);
184 static const AnyTypeId MyGame_Example2_Monster = AnyTypeId._(3);
185 static const Map<int, AnyTypeId> values = {
186 0: NONE,
187 1: Monster,
188 2: TestSimpleTableWithEnum,
189 3: MyGame_Example2_Monster};
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700190
James Kuszmaul8e62b022022-03-22 09:33:25 -0700191 static const fb.Reader<AnyTypeId> reader = _AnyTypeIdReader();
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700192
193 @override
194 String toString() {
195 return 'AnyTypeId{value: $value}';
196 }
197}
198
199class _AnyTypeIdReader extends fb.Reader<AnyTypeId> {
200 const _AnyTypeIdReader();
201
202 @override
203 int get size => 1;
204
205 @override
206 AnyTypeId read(fb.BufferContext bc, int offset) =>
James Kuszmaul8e62b022022-03-22 09:33:25 -0700207 AnyTypeId.fromValue(const fb.Uint8Reader().read(bc, offset));
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700208}
209
210class AnyUniqueAliasesTypeId {
211 final int value;
212 const AnyUniqueAliasesTypeId._(this.value);
213
214 factory AnyUniqueAliasesTypeId.fromValue(int value) {
James Kuszmaul8e62b022022-03-22 09:33:25 -0700215 final result = values[value];
216 if (result == null) {
217 throw StateError('Invalid value $value for bit flag enum AnyUniqueAliasesTypeId');
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700218 }
James Kuszmaul8e62b022022-03-22 09:33:25 -0700219 return result;
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700220 }
221
James Kuszmaul8e62b022022-03-22 09:33:25 -0700222 static AnyUniqueAliasesTypeId? _createOrNull(int? value) =>
223 value == null ? null : AnyUniqueAliasesTypeId.fromValue(value);
224
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700225 static const int minValue = 0;
226 static const int maxValue = 3;
227 static bool containsValue(int value) => values.containsKey(value);
228
James Kuszmaul8e62b022022-03-22 09:33:25 -0700229 static const AnyUniqueAliasesTypeId NONE = AnyUniqueAliasesTypeId._(0);
230 static const AnyUniqueAliasesTypeId M = AnyUniqueAliasesTypeId._(1);
231 static const AnyUniqueAliasesTypeId TS = AnyUniqueAliasesTypeId._(2);
232 static const AnyUniqueAliasesTypeId M2 = AnyUniqueAliasesTypeId._(3);
233 static const Map<int, AnyUniqueAliasesTypeId> values = {
234 0: NONE,
235 1: M,
236 2: TS,
237 3: M2};
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700238
James Kuszmaul8e62b022022-03-22 09:33:25 -0700239 static const fb.Reader<AnyUniqueAliasesTypeId> reader = _AnyUniqueAliasesTypeIdReader();
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700240
241 @override
242 String toString() {
243 return 'AnyUniqueAliasesTypeId{value: $value}';
244 }
245}
246
247class _AnyUniqueAliasesTypeIdReader extends fb.Reader<AnyUniqueAliasesTypeId> {
248 const _AnyUniqueAliasesTypeIdReader();
249
250 @override
251 int get size => 1;
252
253 @override
254 AnyUniqueAliasesTypeId read(fb.BufferContext bc, int offset) =>
James Kuszmaul8e62b022022-03-22 09:33:25 -0700255 AnyUniqueAliasesTypeId.fromValue(const fb.Uint8Reader().read(bc, offset));
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700256}
257
258class AnyAmbiguousAliasesTypeId {
259 final int value;
260 const AnyAmbiguousAliasesTypeId._(this.value);
261
262 factory AnyAmbiguousAliasesTypeId.fromValue(int value) {
James Kuszmaul8e62b022022-03-22 09:33:25 -0700263 final result = values[value];
264 if (result == null) {
265 throw StateError('Invalid value $value for bit flag enum AnyAmbiguousAliasesTypeId');
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700266 }
James Kuszmaul8e62b022022-03-22 09:33:25 -0700267 return result;
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700268 }
269
James Kuszmaul8e62b022022-03-22 09:33:25 -0700270 static AnyAmbiguousAliasesTypeId? _createOrNull(int? value) =>
271 value == null ? null : AnyAmbiguousAliasesTypeId.fromValue(value);
272
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700273 static const int minValue = 0;
274 static const int maxValue = 3;
275 static bool containsValue(int value) => values.containsKey(value);
276
James Kuszmaul8e62b022022-03-22 09:33:25 -0700277 static const AnyAmbiguousAliasesTypeId NONE = AnyAmbiguousAliasesTypeId._(0);
278 static const AnyAmbiguousAliasesTypeId M1 = AnyAmbiguousAliasesTypeId._(1);
279 static const AnyAmbiguousAliasesTypeId M2 = AnyAmbiguousAliasesTypeId._(2);
280 static const AnyAmbiguousAliasesTypeId M3 = AnyAmbiguousAliasesTypeId._(3);
281 static const Map<int, AnyAmbiguousAliasesTypeId> values = {
282 0: NONE,
283 1: M1,
284 2: M2,
285 3: M3};
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700286
James Kuszmaul8e62b022022-03-22 09:33:25 -0700287 static const fb.Reader<AnyAmbiguousAliasesTypeId> reader = _AnyAmbiguousAliasesTypeIdReader();
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700288
289 @override
290 String toString() {
291 return 'AnyAmbiguousAliasesTypeId{value: $value}';
292 }
293}
294
295class _AnyAmbiguousAliasesTypeIdReader extends fb.Reader<AnyAmbiguousAliasesTypeId> {
296 const _AnyAmbiguousAliasesTypeIdReader();
297
298 @override
299 int get size => 1;
300
301 @override
302 AnyAmbiguousAliasesTypeId read(fb.BufferContext bc, int offset) =>
James Kuszmaul8e62b022022-03-22 09:33:25 -0700303 AnyAmbiguousAliasesTypeId.fromValue(const fb.Uint8Reader().read(bc, offset));
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700304}
305
306class Test {
307 Test._(this._bc, this._bcOffset);
308
James Kuszmaul8e62b022022-03-22 09:33:25 -0700309 static const fb.Reader<Test> reader = _TestReader();
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700310
311 final fb.BufferContext _bc;
312 final int _bcOffset;
313
314 int get a => const fb.Int16Reader().read(_bc, _bcOffset + 0);
315 int get b => const fb.Int8Reader().read(_bc, _bcOffset + 2);
316
317 @override
318 String toString() {
Austin Schuh2dd86a92022-09-14 21:19:23 -0700319 return 'Test{a: ${a}, b: ${b}}';
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700320 }
James Kuszmaul8e62b022022-03-22 09:33:25 -0700321
322 TestT unpack() => TestT(
323 a: a,
324 b: b);
325
326 static int pack(fb.Builder fbBuilder, TestT? object) {
327 if (object == null) return 0;
328 return object.pack(fbBuilder);
329 }
330}
331
332class TestT implements fb.Packable {
333 int a;
334 int b;
335
336 TestT({
337 required this.a,
338 required this.b});
339
340 @override
341 int pack(fb.Builder fbBuilder) {
342 fbBuilder.pad(1);
343 fbBuilder.putInt8(b);
344 fbBuilder.putInt16(a);
345 return fbBuilder.offset;
346 }
347
348 @override
349 String toString() {
Austin Schuh2dd86a92022-09-14 21:19:23 -0700350 return 'TestT{a: ${a}, b: ${b}}';
James Kuszmaul8e62b022022-03-22 09:33:25 -0700351 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700352}
353
354class _TestReader extends fb.StructReader<Test> {
355 const _TestReader();
356
357 @override
358 int get size => 4;
359
360 @override
361 Test createObject(fb.BufferContext bc, int offset) =>
James Kuszmaul8e62b022022-03-22 09:33:25 -0700362 Test._(bc, offset);
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700363}
364
365class TestBuilder {
James Kuszmaul8e62b022022-03-22 09:33:25 -0700366 TestBuilder(this.fbBuilder);
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700367
368 final fb.Builder fbBuilder;
369
370 int finish(int a, int b) {
371 fbBuilder.pad(1);
372 fbBuilder.putInt8(b);
373 fbBuilder.putInt16(a);
374 return fbBuilder.offset;
375 }
376
377}
378
379class TestObjectBuilder extends fb.ObjectBuilder {
380 final int _a;
381 final int _b;
382
383 TestObjectBuilder({
James Kuszmaul8e62b022022-03-22 09:33:25 -0700384 required int a,
385 required int b,
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700386 })
387 : _a = a,
388 _b = b;
389
390 /// Finish building, and store into the [fbBuilder].
391 @override
James Kuszmaul8e62b022022-03-22 09:33:25 -0700392 int finish(fb.Builder fbBuilder) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700393 fbBuilder.pad(1);
394 fbBuilder.putInt8(_b);
395 fbBuilder.putInt16(_a);
396 return fbBuilder.offset;
397 }
398
399 /// Convenience method to serialize to byte list.
400 @override
James Kuszmaul8e62b022022-03-22 09:33:25 -0700401 Uint8List toBytes([String? fileIdentifier]) {
402 final fbBuilder = fb.Builder(deduplicateTables: false);
403 fbBuilder.finish(finish(fbBuilder), fileIdentifier);
404 return fbBuilder.buffer;
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700405 }
406}
407class TestSimpleTableWithEnum {
408 TestSimpleTableWithEnum._(this._bc, this._bcOffset);
409 factory TestSimpleTableWithEnum(List<int> bytes) {
James Kuszmaul8e62b022022-03-22 09:33:25 -0700410 final rootRef = fb.BufferContext.fromBytes(bytes);
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700411 return reader.read(rootRef, 0);
412 }
413
James Kuszmaul8e62b022022-03-22 09:33:25 -0700414 static const fb.Reader<TestSimpleTableWithEnum> reader = _TestSimpleTableWithEnumReader();
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700415
416 final fb.BufferContext _bc;
417 final int _bcOffset;
418
James Kuszmaul8e62b022022-03-22 09:33:25 -0700419 Color get color => Color.fromValue(const fb.Uint8Reader().vTableGet(_bc, _bcOffset, 4, 2));
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700420
421 @override
422 String toString() {
Austin Schuh2dd86a92022-09-14 21:19:23 -0700423 return 'TestSimpleTableWithEnum{color: ${color}}';
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700424 }
James Kuszmaul8e62b022022-03-22 09:33:25 -0700425
426 TestSimpleTableWithEnumT unpack() => TestSimpleTableWithEnumT(
427 color: color);
428
429 static int pack(fb.Builder fbBuilder, TestSimpleTableWithEnumT? object) {
430 if (object == null) return 0;
431 return object.pack(fbBuilder);
432 }
433}
434
435class TestSimpleTableWithEnumT implements fb.Packable {
436 Color color;
437
438 TestSimpleTableWithEnumT({
439 this.color = Color.Green});
440
441 @override
442 int pack(fb.Builder fbBuilder) {
443 fbBuilder.startTable(1);
444 fbBuilder.addUint8(0, color.value);
445 return fbBuilder.endTable();
446 }
447
448 @override
449 String toString() {
Austin Schuh2dd86a92022-09-14 21:19:23 -0700450 return 'TestSimpleTableWithEnumT{color: ${color}}';
James Kuszmaul8e62b022022-03-22 09:33:25 -0700451 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700452}
453
454class _TestSimpleTableWithEnumReader extends fb.TableReader<TestSimpleTableWithEnum> {
455 const _TestSimpleTableWithEnumReader();
456
457 @override
458 TestSimpleTableWithEnum createObject(fb.BufferContext bc, int offset) =>
James Kuszmaul8e62b022022-03-22 09:33:25 -0700459 TestSimpleTableWithEnum._(bc, offset);
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700460}
461
462class TestSimpleTableWithEnumBuilder {
James Kuszmaul8e62b022022-03-22 09:33:25 -0700463 TestSimpleTableWithEnumBuilder(this.fbBuilder);
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700464
465 final fb.Builder fbBuilder;
466
467 void begin() {
James Kuszmaul8e62b022022-03-22 09:33:25 -0700468 fbBuilder.startTable(1);
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700469 }
470
James Kuszmaul8e62b022022-03-22 09:33:25 -0700471 int addColor(Color? color) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700472 fbBuilder.addUint8(0, color?.value);
473 return fbBuilder.offset;
474 }
475
476 int finish() {
477 return fbBuilder.endTable();
478 }
479}
480
481class TestSimpleTableWithEnumObjectBuilder extends fb.ObjectBuilder {
James Kuszmaul8e62b022022-03-22 09:33:25 -0700482 final Color? _color;
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700483
484 TestSimpleTableWithEnumObjectBuilder({
James Kuszmaul8e62b022022-03-22 09:33:25 -0700485 Color? color,
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700486 })
487 : _color = color;
488
489 /// Finish building, and store into the [fbBuilder].
490 @override
James Kuszmaul8e62b022022-03-22 09:33:25 -0700491 int finish(fb.Builder fbBuilder) {
492 fbBuilder.startTable(1);
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700493 fbBuilder.addUint8(0, _color?.value);
494 return fbBuilder.endTable();
495 }
496
497 /// Convenience method to serialize to byte list.
498 @override
James Kuszmaul8e62b022022-03-22 09:33:25 -0700499 Uint8List toBytes([String? fileIdentifier]) {
500 final fbBuilder = fb.Builder(deduplicateTables: false);
501 fbBuilder.finish(finish(fbBuilder), fileIdentifier);
502 return fbBuilder.buffer;
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700503 }
504}
505class Vec3 {
506 Vec3._(this._bc, this._bcOffset);
507
James Kuszmaul8e62b022022-03-22 09:33:25 -0700508 static const fb.Reader<Vec3> reader = _Vec3Reader();
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700509
510 final fb.BufferContext _bc;
511 final int _bcOffset;
512
513 double get x => const fb.Float32Reader().read(_bc, _bcOffset + 0);
514 double get y => const fb.Float32Reader().read(_bc, _bcOffset + 4);
515 double get z => const fb.Float32Reader().read(_bc, _bcOffset + 8);
516 double get test1 => const fb.Float64Reader().read(_bc, _bcOffset + 16);
James Kuszmaul8e62b022022-03-22 09:33:25 -0700517 Color get test2 => Color.fromValue(const fb.Uint8Reader().read(_bc, _bcOffset + 24));
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700518 Test get test3 => Test.reader.read(_bc, _bcOffset + 26);
519
520 @override
521 String toString() {
Austin Schuh2dd86a92022-09-14 21:19:23 -0700522 return 'Vec3{x: ${x}, y: ${y}, z: ${z}, test1: ${test1}, test2: ${test2}, test3: ${test3}}';
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700523 }
James Kuszmaul8e62b022022-03-22 09:33:25 -0700524
525 Vec3T unpack() => Vec3T(
526 x: x,
527 y: y,
528 z: z,
529 test1: test1,
530 test2: test2,
531 test3: test3.unpack());
532
533 static int pack(fb.Builder fbBuilder, Vec3T? object) {
534 if (object == null) return 0;
535 return object.pack(fbBuilder);
536 }
537}
538
539class Vec3T implements fb.Packable {
540 double x;
541 double y;
542 double z;
543 double test1;
544 Color test2;
545 TestT test3;
546
547 Vec3T({
548 required this.x,
549 required this.y,
550 required this.z,
551 required this.test1,
552 required this.test2,
553 required this.test3});
554
555 @override
556 int pack(fb.Builder fbBuilder) {
557 fbBuilder.pad(2);
558 test3.pack(fbBuilder);
559 fbBuilder.pad(1);
560 fbBuilder.putUint8(test2.value);
561 fbBuilder.putFloat64(test1);
562 fbBuilder.pad(4);
563 fbBuilder.putFloat32(z);
564 fbBuilder.putFloat32(y);
565 fbBuilder.putFloat32(x);
566 return fbBuilder.offset;
567 }
568
569 @override
570 String toString() {
Austin Schuh2dd86a92022-09-14 21:19:23 -0700571 return 'Vec3T{x: ${x}, y: ${y}, z: ${z}, test1: ${test1}, test2: ${test2}, test3: ${test3}}';
James Kuszmaul8e62b022022-03-22 09:33:25 -0700572 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700573}
574
575class _Vec3Reader extends fb.StructReader<Vec3> {
576 const _Vec3Reader();
577
578 @override
579 int get size => 32;
580
581 @override
582 Vec3 createObject(fb.BufferContext bc, int offset) =>
James Kuszmaul8e62b022022-03-22 09:33:25 -0700583 Vec3._(bc, offset);
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700584}
585
586class Vec3Builder {
James Kuszmaul8e62b022022-03-22 09:33:25 -0700587 Vec3Builder(this.fbBuilder);
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700588
589 final fb.Builder fbBuilder;
590
591 int finish(double x, double y, double z, double test1, Color test2, fb.StructBuilder test3) {
592 fbBuilder.pad(2);
593 test3();
594 fbBuilder.pad(1);
James Kuszmaul8e62b022022-03-22 09:33:25 -0700595 fbBuilder.putUint8(test2.value);
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700596 fbBuilder.putFloat64(test1);
597 fbBuilder.pad(4);
598 fbBuilder.putFloat32(z);
599 fbBuilder.putFloat32(y);
600 fbBuilder.putFloat32(x);
601 return fbBuilder.offset;
602 }
603
604}
605
606class Vec3ObjectBuilder extends fb.ObjectBuilder {
607 final double _x;
608 final double _y;
609 final double _z;
610 final double _test1;
611 final Color _test2;
612 final TestObjectBuilder _test3;
613
614 Vec3ObjectBuilder({
James Kuszmaul8e62b022022-03-22 09:33:25 -0700615 required double x,
616 required double y,
617 required double z,
618 required double test1,
619 required Color test2,
620 required TestObjectBuilder test3,
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700621 })
622 : _x = x,
623 _y = y,
624 _z = z,
625 _test1 = test1,
626 _test2 = test2,
627 _test3 = test3;
628
629 /// Finish building, and store into the [fbBuilder].
630 @override
James Kuszmaul8e62b022022-03-22 09:33:25 -0700631 int finish(fb.Builder fbBuilder) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700632 fbBuilder.pad(2);
633 _test3.finish(fbBuilder);
634 fbBuilder.pad(1);
James Kuszmaul8e62b022022-03-22 09:33:25 -0700635 fbBuilder.putUint8(_test2.value);
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700636 fbBuilder.putFloat64(_test1);
637 fbBuilder.pad(4);
638 fbBuilder.putFloat32(_z);
639 fbBuilder.putFloat32(_y);
640 fbBuilder.putFloat32(_x);
641 return fbBuilder.offset;
642 }
643
644 /// Convenience method to serialize to byte list.
645 @override
James Kuszmaul8e62b022022-03-22 09:33:25 -0700646 Uint8List toBytes([String? fileIdentifier]) {
647 final fbBuilder = fb.Builder(deduplicateTables: false);
648 fbBuilder.finish(finish(fbBuilder), fileIdentifier);
649 return fbBuilder.buffer;
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700650 }
651}
652class Ability {
653 Ability._(this._bc, this._bcOffset);
654
James Kuszmaul8e62b022022-03-22 09:33:25 -0700655 static const fb.Reader<Ability> reader = _AbilityReader();
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700656
657 final fb.BufferContext _bc;
658 final int _bcOffset;
659
660 int get id => const fb.Uint32Reader().read(_bc, _bcOffset + 0);
661 int get distance => const fb.Uint32Reader().read(_bc, _bcOffset + 4);
662
663 @override
664 String toString() {
Austin Schuh2dd86a92022-09-14 21:19:23 -0700665 return 'Ability{id: ${id}, distance: ${distance}}';
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700666 }
James Kuszmaul8e62b022022-03-22 09:33:25 -0700667
668 AbilityT unpack() => AbilityT(
669 id: id,
670 distance: distance);
671
672 static int pack(fb.Builder fbBuilder, AbilityT? object) {
673 if (object == null) return 0;
674 return object.pack(fbBuilder);
675 }
676}
677
678class AbilityT implements fb.Packable {
679 int id;
680 int distance;
681
682 AbilityT({
683 required this.id,
684 required this.distance});
685
686 @override
687 int pack(fb.Builder fbBuilder) {
688 fbBuilder.putUint32(distance);
689 fbBuilder.putUint32(id);
690 return fbBuilder.offset;
691 }
692
693 @override
694 String toString() {
Austin Schuh2dd86a92022-09-14 21:19:23 -0700695 return 'AbilityT{id: ${id}, distance: ${distance}}';
James Kuszmaul8e62b022022-03-22 09:33:25 -0700696 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700697}
698
699class _AbilityReader extends fb.StructReader<Ability> {
700 const _AbilityReader();
701
702 @override
703 int get size => 8;
704
705 @override
706 Ability createObject(fb.BufferContext bc, int offset) =>
James Kuszmaul8e62b022022-03-22 09:33:25 -0700707 Ability._(bc, offset);
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700708}
709
710class AbilityBuilder {
James Kuszmaul8e62b022022-03-22 09:33:25 -0700711 AbilityBuilder(this.fbBuilder);
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700712
713 final fb.Builder fbBuilder;
714
715 int finish(int id, int distance) {
716 fbBuilder.putUint32(distance);
717 fbBuilder.putUint32(id);
718 return fbBuilder.offset;
719 }
720
721}
722
723class AbilityObjectBuilder extends fb.ObjectBuilder {
724 final int _id;
725 final int _distance;
726
727 AbilityObjectBuilder({
James Kuszmaul8e62b022022-03-22 09:33:25 -0700728 required int id,
729 required int distance,
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700730 })
731 : _id = id,
732 _distance = distance;
733
734 /// Finish building, and store into the [fbBuilder].
735 @override
James Kuszmaul8e62b022022-03-22 09:33:25 -0700736 int finish(fb.Builder fbBuilder) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700737 fbBuilder.putUint32(_distance);
738 fbBuilder.putUint32(_id);
739 return fbBuilder.offset;
740 }
741
742 /// Convenience method to serialize to byte list.
743 @override
James Kuszmaul8e62b022022-03-22 09:33:25 -0700744 Uint8List toBytes([String? fileIdentifier]) {
745 final fbBuilder = fb.Builder(deduplicateTables: false);
746 fbBuilder.finish(finish(fbBuilder), fileIdentifier);
747 return fbBuilder.buffer;
748 }
749}
750class StructOfStructs {
751 StructOfStructs._(this._bc, this._bcOffset);
752
753 static const fb.Reader<StructOfStructs> reader = _StructOfStructsReader();
754
755 final fb.BufferContext _bc;
756 final int _bcOffset;
757
758 Ability get a => Ability.reader.read(_bc, _bcOffset + 0);
759 Test get b => Test.reader.read(_bc, _bcOffset + 8);
760 Ability get c => Ability.reader.read(_bc, _bcOffset + 12);
761
762 @override
763 String toString() {
Austin Schuh2dd86a92022-09-14 21:19:23 -0700764 return 'StructOfStructs{a: ${a}, b: ${b}, c: ${c}}';
James Kuszmaul8e62b022022-03-22 09:33:25 -0700765 }
766
767 StructOfStructsT unpack() => StructOfStructsT(
768 a: a.unpack(),
769 b: b.unpack(),
770 c: c.unpack());
771
772 static int pack(fb.Builder fbBuilder, StructOfStructsT? object) {
773 if (object == null) return 0;
774 return object.pack(fbBuilder);
775 }
776}
777
778class StructOfStructsT implements fb.Packable {
779 AbilityT a;
780 TestT b;
781 AbilityT c;
782
783 StructOfStructsT({
784 required this.a,
785 required this.b,
786 required this.c});
787
788 @override
789 int pack(fb.Builder fbBuilder) {
790 c.pack(fbBuilder);
791 b.pack(fbBuilder);
792 a.pack(fbBuilder);
793 return fbBuilder.offset;
794 }
795
796 @override
797 String toString() {
Austin Schuh2dd86a92022-09-14 21:19:23 -0700798 return 'StructOfStructsT{a: ${a}, b: ${b}, c: ${c}}';
James Kuszmaul8e62b022022-03-22 09:33:25 -0700799 }
800}
801
802class _StructOfStructsReader extends fb.StructReader<StructOfStructs> {
803 const _StructOfStructsReader();
804
805 @override
806 int get size => 20;
807
808 @override
809 StructOfStructs createObject(fb.BufferContext bc, int offset) =>
810 StructOfStructs._(bc, offset);
811}
812
813class StructOfStructsBuilder {
814 StructOfStructsBuilder(this.fbBuilder);
815
816 final fb.Builder fbBuilder;
817
818 int finish(fb.StructBuilder a, fb.StructBuilder b, fb.StructBuilder c) {
819 c();
820 b();
821 a();
822 return fbBuilder.offset;
823 }
824
825}
826
827class StructOfStructsObjectBuilder extends fb.ObjectBuilder {
828 final AbilityObjectBuilder _a;
829 final TestObjectBuilder _b;
830 final AbilityObjectBuilder _c;
831
832 StructOfStructsObjectBuilder({
833 required AbilityObjectBuilder a,
834 required TestObjectBuilder b,
835 required AbilityObjectBuilder c,
836 })
837 : _a = a,
838 _b = b,
839 _c = c;
840
841 /// Finish building, and store into the [fbBuilder].
842 @override
843 int finish(fb.Builder fbBuilder) {
844 _c.finish(fbBuilder);
845 _b.finish(fbBuilder);
846 _a.finish(fbBuilder);
847 return fbBuilder.offset;
848 }
849
850 /// Convenience method to serialize to byte list.
851 @override
852 Uint8List toBytes([String? fileIdentifier]) {
853 final fbBuilder = fb.Builder(deduplicateTables: false);
854 fbBuilder.finish(finish(fbBuilder), fileIdentifier);
855 return fbBuilder.buffer;
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700856 }
857}
Austin Schuh2dd86a92022-09-14 21:19:23 -0700858class StructOfStructsOfStructs {
859 StructOfStructsOfStructs._(this._bc, this._bcOffset);
860
861 static const fb.Reader<StructOfStructsOfStructs> reader = _StructOfStructsOfStructsReader();
862
863 final fb.BufferContext _bc;
864 final int _bcOffset;
865
866 StructOfStructs get a => StructOfStructs.reader.read(_bc, _bcOffset + 0);
867
868 @override
869 String toString() {
870 return 'StructOfStructsOfStructs{a: ${a}}';
871 }
872
873 StructOfStructsOfStructsT unpack() => StructOfStructsOfStructsT(
874 a: a.unpack());
875
876 static int pack(fb.Builder fbBuilder, StructOfStructsOfStructsT? object) {
877 if (object == null) return 0;
878 return object.pack(fbBuilder);
879 }
880}
881
882class StructOfStructsOfStructsT implements fb.Packable {
883 StructOfStructsT a;
884
885 StructOfStructsOfStructsT({
886 required this.a});
887
888 @override
889 int pack(fb.Builder fbBuilder) {
890 a.pack(fbBuilder);
891 return fbBuilder.offset;
892 }
893
894 @override
895 String toString() {
896 return 'StructOfStructsOfStructsT{a: ${a}}';
897 }
898}
899
900class _StructOfStructsOfStructsReader extends fb.StructReader<StructOfStructsOfStructs> {
901 const _StructOfStructsOfStructsReader();
902
903 @override
904 int get size => 20;
905
906 @override
907 StructOfStructsOfStructs createObject(fb.BufferContext bc, int offset) =>
908 StructOfStructsOfStructs._(bc, offset);
909}
910
911class StructOfStructsOfStructsBuilder {
912 StructOfStructsOfStructsBuilder(this.fbBuilder);
913
914 final fb.Builder fbBuilder;
915
916 int finish(fb.StructBuilder a) {
917 a();
918 return fbBuilder.offset;
919 }
920
921}
922
923class StructOfStructsOfStructsObjectBuilder extends fb.ObjectBuilder {
924 final StructOfStructsObjectBuilder _a;
925
926 StructOfStructsOfStructsObjectBuilder({
927 required StructOfStructsObjectBuilder a,
928 })
929 : _a = a;
930
931 /// Finish building, and store into the [fbBuilder].
932 @override
933 int finish(fb.Builder fbBuilder) {
934 _a.finish(fbBuilder);
935 return fbBuilder.offset;
936 }
937
938 /// Convenience method to serialize to byte list.
939 @override
940 Uint8List toBytes([String? fileIdentifier]) {
941 final fbBuilder = fb.Builder(deduplicateTables: false);
942 fbBuilder.finish(finish(fbBuilder), fileIdentifier);
943 return fbBuilder.buffer;
944 }
945}
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700946class Stat {
947 Stat._(this._bc, this._bcOffset);
948 factory Stat(List<int> bytes) {
James Kuszmaul8e62b022022-03-22 09:33:25 -0700949 final rootRef = fb.BufferContext.fromBytes(bytes);
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700950 return reader.read(rootRef, 0);
951 }
952
James Kuszmaul8e62b022022-03-22 09:33:25 -0700953 static const fb.Reader<Stat> reader = _StatReader();
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700954
955 final fb.BufferContext _bc;
956 final int _bcOffset;
957
James Kuszmaul8e62b022022-03-22 09:33:25 -0700958 String? get id => const fb.StringReader().vTableGetNullable(_bc, _bcOffset, 4);
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700959 int get val => const fb.Int64Reader().vTableGet(_bc, _bcOffset, 6, 0);
960 int get count => const fb.Uint16Reader().vTableGet(_bc, _bcOffset, 8, 0);
961
962 @override
963 String toString() {
Austin Schuh2dd86a92022-09-14 21:19:23 -0700964 return 'Stat{id: ${id}, val: ${val}, count: ${count}}';
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700965 }
James Kuszmaul8e62b022022-03-22 09:33:25 -0700966
967 StatT unpack() => StatT(
968 id: id,
969 val: val,
970 count: count);
971
972 static int pack(fb.Builder fbBuilder, StatT? object) {
973 if (object == null) return 0;
974 return object.pack(fbBuilder);
975 }
976}
977
978class StatT implements fb.Packable {
979 String? id;
980 int val;
981 int count;
982
983 StatT({
984 this.id,
985 this.val = 0,
986 this.count = 0});
987
988 @override
989 int pack(fb.Builder fbBuilder) {
990 final int? idOffset = id == null ? null
991 : fbBuilder.writeString(id!);
992 fbBuilder.startTable(3);
993 fbBuilder.addOffset(0, idOffset);
994 fbBuilder.addInt64(1, val);
995 fbBuilder.addUint16(2, count);
996 return fbBuilder.endTable();
997 }
998
999 @override
1000 String toString() {
Austin Schuh2dd86a92022-09-14 21:19:23 -07001001 return 'StatT{id: ${id}, val: ${val}, count: ${count}}';
James Kuszmaul8e62b022022-03-22 09:33:25 -07001002 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001003}
1004
1005class _StatReader extends fb.TableReader<Stat> {
1006 const _StatReader();
1007
1008 @override
1009 Stat createObject(fb.BufferContext bc, int offset) =>
James Kuszmaul8e62b022022-03-22 09:33:25 -07001010 Stat._(bc, offset);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001011}
1012
1013class StatBuilder {
James Kuszmaul8e62b022022-03-22 09:33:25 -07001014 StatBuilder(this.fbBuilder);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001015
1016 final fb.Builder fbBuilder;
1017
1018 void begin() {
James Kuszmaul8e62b022022-03-22 09:33:25 -07001019 fbBuilder.startTable(3);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001020 }
1021
James Kuszmaul8e62b022022-03-22 09:33:25 -07001022 int addIdOffset(int? offset) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001023 fbBuilder.addOffset(0, offset);
1024 return fbBuilder.offset;
1025 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001026 int addVal(int? val) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001027 fbBuilder.addInt64(1, val);
1028 return fbBuilder.offset;
1029 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001030 int addCount(int? count) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001031 fbBuilder.addUint16(2, count);
1032 return fbBuilder.offset;
1033 }
1034
1035 int finish() {
1036 return fbBuilder.endTable();
1037 }
1038}
1039
1040class StatObjectBuilder extends fb.ObjectBuilder {
James Kuszmaul8e62b022022-03-22 09:33:25 -07001041 final String? _id;
1042 final int? _val;
1043 final int? _count;
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001044
1045 StatObjectBuilder({
James Kuszmaul8e62b022022-03-22 09:33:25 -07001046 String? id,
1047 int? val,
1048 int? count,
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001049 })
1050 : _id = id,
1051 _val = val,
1052 _count = count;
1053
1054 /// Finish building, and store into the [fbBuilder].
1055 @override
James Kuszmaul8e62b022022-03-22 09:33:25 -07001056 int finish(fb.Builder fbBuilder) {
1057 final int? idOffset = _id == null ? null
1058 : fbBuilder.writeString(_id!);
1059 fbBuilder.startTable(3);
1060 fbBuilder.addOffset(0, idOffset);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001061 fbBuilder.addInt64(1, _val);
1062 fbBuilder.addUint16(2, _count);
1063 return fbBuilder.endTable();
1064 }
1065
1066 /// Convenience method to serialize to byte list.
1067 @override
James Kuszmaul8e62b022022-03-22 09:33:25 -07001068 Uint8List toBytes([String? fileIdentifier]) {
1069 final fbBuilder = fb.Builder(deduplicateTables: false);
1070 fbBuilder.finish(finish(fbBuilder), fileIdentifier);
1071 return fbBuilder.buffer;
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001072 }
1073}
1074class Referrable {
1075 Referrable._(this._bc, this._bcOffset);
1076 factory Referrable(List<int> bytes) {
James Kuszmaul8e62b022022-03-22 09:33:25 -07001077 final rootRef = fb.BufferContext.fromBytes(bytes);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001078 return reader.read(rootRef, 0);
1079 }
1080
James Kuszmaul8e62b022022-03-22 09:33:25 -07001081 static const fb.Reader<Referrable> reader = _ReferrableReader();
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001082
1083 final fb.BufferContext _bc;
1084 final int _bcOffset;
1085
1086 int get id => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 4, 0);
1087
1088 @override
1089 String toString() {
Austin Schuh2dd86a92022-09-14 21:19:23 -07001090 return 'Referrable{id: ${id}}';
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001091 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001092
1093 ReferrableT unpack() => ReferrableT(
1094 id: id);
1095
1096 static int pack(fb.Builder fbBuilder, ReferrableT? object) {
1097 if (object == null) return 0;
1098 return object.pack(fbBuilder);
1099 }
1100}
1101
1102class ReferrableT implements fb.Packable {
1103 int id;
1104
1105 ReferrableT({
1106 this.id = 0});
1107
1108 @override
1109 int pack(fb.Builder fbBuilder) {
1110 fbBuilder.startTable(1);
1111 fbBuilder.addUint64(0, id);
1112 return fbBuilder.endTable();
1113 }
1114
1115 @override
1116 String toString() {
Austin Schuh2dd86a92022-09-14 21:19:23 -07001117 return 'ReferrableT{id: ${id}}';
James Kuszmaul8e62b022022-03-22 09:33:25 -07001118 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001119}
1120
1121class _ReferrableReader extends fb.TableReader<Referrable> {
1122 const _ReferrableReader();
1123
1124 @override
1125 Referrable createObject(fb.BufferContext bc, int offset) =>
James Kuszmaul8e62b022022-03-22 09:33:25 -07001126 Referrable._(bc, offset);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001127}
1128
1129class ReferrableBuilder {
James Kuszmaul8e62b022022-03-22 09:33:25 -07001130 ReferrableBuilder(this.fbBuilder);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001131
1132 final fb.Builder fbBuilder;
1133
1134 void begin() {
James Kuszmaul8e62b022022-03-22 09:33:25 -07001135 fbBuilder.startTable(1);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001136 }
1137
James Kuszmaul8e62b022022-03-22 09:33:25 -07001138 int addId(int? id) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001139 fbBuilder.addUint64(0, id);
1140 return fbBuilder.offset;
1141 }
1142
1143 int finish() {
1144 return fbBuilder.endTable();
1145 }
1146}
1147
1148class ReferrableObjectBuilder extends fb.ObjectBuilder {
James Kuszmaul8e62b022022-03-22 09:33:25 -07001149 final int? _id;
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001150
1151 ReferrableObjectBuilder({
James Kuszmaul8e62b022022-03-22 09:33:25 -07001152 int? id,
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001153 })
1154 : _id = id;
1155
1156 /// Finish building, and store into the [fbBuilder].
1157 @override
James Kuszmaul8e62b022022-03-22 09:33:25 -07001158 int finish(fb.Builder fbBuilder) {
1159 fbBuilder.startTable(1);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001160 fbBuilder.addUint64(0, _id);
1161 return fbBuilder.endTable();
1162 }
1163
1164 /// Convenience method to serialize to byte list.
1165 @override
James Kuszmaul8e62b022022-03-22 09:33:25 -07001166 Uint8List toBytes([String? fileIdentifier]) {
1167 final fbBuilder = fb.Builder(deduplicateTables: false);
1168 fbBuilder.finish(finish(fbBuilder), fileIdentifier);
1169 return fbBuilder.buffer;
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001170 }
1171}
Austin Schuh272c6132020-11-14 16:37:52 -08001172/// an example documentation comment: "monster object"
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001173class Monster {
1174 Monster._(this._bc, this._bcOffset);
1175 factory Monster(List<int> bytes) {
James Kuszmaul8e62b022022-03-22 09:33:25 -07001176 final rootRef = fb.BufferContext.fromBytes(bytes);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001177 return reader.read(rootRef, 0);
1178 }
1179
James Kuszmaul8e62b022022-03-22 09:33:25 -07001180 static const fb.Reader<Monster> reader = _MonsterReader();
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001181
1182 final fb.BufferContext _bc;
1183 final int _bcOffset;
1184
James Kuszmaul8e62b022022-03-22 09:33:25 -07001185 Vec3? get pos => Vec3.reader.vTableGetNullable(_bc, _bcOffset, 4);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001186 int get mana => const fb.Int16Reader().vTableGet(_bc, _bcOffset, 6, 150);
1187 int get hp => const fb.Int16Reader().vTableGet(_bc, _bcOffset, 8, 100);
James Kuszmaul8e62b022022-03-22 09:33:25 -07001188 String? get name => const fb.StringReader().vTableGetNullable(_bc, _bcOffset, 10);
1189 List<int>? get inventory => const fb.Uint8ListReader().vTableGetNullable(_bc, _bcOffset, 14);
1190 Color get color => Color.fromValue(const fb.Uint8Reader().vTableGet(_bc, _bcOffset, 16, 8));
1191 AnyTypeId? get testType => AnyTypeId._createOrNull(const fb.Uint8Reader().vTableGetNullable(_bc, _bcOffset, 18));
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001192 dynamic get test {
1193 switch (testType?.value) {
James Kuszmaul8e62b022022-03-22 09:33:25 -07001194 case 1: return Monster.reader.vTableGetNullable(_bc, _bcOffset, 20);
1195 case 2: return TestSimpleTableWithEnum.reader.vTableGetNullable(_bc, _bcOffset, 20);
1196 case 3: return my_game_example2.Monster.reader.vTableGetNullable(_bc, _bcOffset, 20);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001197 default: return null;
1198 }
1199 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001200 List<Test>? get test4 => const fb.ListReader<Test>(Test.reader).vTableGetNullable(_bc, _bcOffset, 22);
1201 List<String>? get testarrayofstring => const fb.ListReader<String>(fb.StringReader()).vTableGetNullable(_bc, _bcOffset, 24);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001202 /// an example documentation comment: this will end up in the generated code
1203 /// multiline too
James Kuszmaul8e62b022022-03-22 09:33:25 -07001204 List<Monster>? get testarrayoftables => const fb.ListReader<Monster>(Monster.reader).vTableGetNullable(_bc, _bcOffset, 26);
1205 Monster? get enemy => Monster.reader.vTableGetNullable(_bc, _bcOffset, 28);
1206 List<int>? get testnestedflatbuffer => const fb.Uint8ListReader().vTableGetNullable(_bc, _bcOffset, 30);
1207 Stat? get testempty => Stat.reader.vTableGetNullable(_bc, _bcOffset, 32);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001208 bool get testbool => const fb.BoolReader().vTableGet(_bc, _bcOffset, 34, false);
1209 int get testhashs32Fnv1 => const fb.Int32Reader().vTableGet(_bc, _bcOffset, 36, 0);
1210 int get testhashu32Fnv1 => const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 38, 0);
1211 int get testhashs64Fnv1 => const fb.Int64Reader().vTableGet(_bc, _bcOffset, 40, 0);
1212 int get testhashu64Fnv1 => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 42, 0);
1213 int get testhashs32Fnv1a => const fb.Int32Reader().vTableGet(_bc, _bcOffset, 44, 0);
1214 int get testhashu32Fnv1a => const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 46, 0);
1215 int get testhashs64Fnv1a => const fb.Int64Reader().vTableGet(_bc, _bcOffset, 48, 0);
1216 int get testhashu64Fnv1a => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 50, 0);
James Kuszmaul8e62b022022-03-22 09:33:25 -07001217 List<bool>? get testarrayofbools => const fb.ListReader<bool>(fb.BoolReader()).vTableGetNullable(_bc, _bcOffset, 52);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001218 double get testf => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 54, 3.14159);
1219 double get testf2 => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 56, 3.0);
1220 double get testf3 => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 58, 0.0);
James Kuszmaul8e62b022022-03-22 09:33:25 -07001221 List<String>? get testarrayofstring2 => const fb.ListReader<String>(fb.StringReader()).vTableGetNullable(_bc, _bcOffset, 60);
1222 List<Ability>? get testarrayofsortedstruct => const fb.ListReader<Ability>(Ability.reader).vTableGetNullable(_bc, _bcOffset, 62);
1223 List<int>? get flex => const fb.Uint8ListReader().vTableGetNullable(_bc, _bcOffset, 64);
1224 List<Test>? get test5 => const fb.ListReader<Test>(Test.reader).vTableGetNullable(_bc, _bcOffset, 66);
1225 List<int>? get vectorOfLongs => const fb.ListReader<int>(fb.Int64Reader()).vTableGetNullable(_bc, _bcOffset, 68);
1226 List<double>? get vectorOfDoubles => const fb.ListReader<double>(fb.Float64Reader()).vTableGetNullable(_bc, _bcOffset, 70);
1227 my_game.InParentNamespace? get parentNamespaceTest => my_game.InParentNamespace.reader.vTableGetNullable(_bc, _bcOffset, 72);
1228 List<Referrable>? get vectorOfReferrables => const fb.ListReader<Referrable>(Referrable.reader).vTableGetNullable(_bc, _bcOffset, 74);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001229 int get singleWeakReference => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 76, 0);
James Kuszmaul8e62b022022-03-22 09:33:25 -07001230 List<int>? get vectorOfWeakReferences => const fb.ListReader<int>(fb.Uint64Reader()).vTableGetNullable(_bc, _bcOffset, 78);
1231 List<Referrable>? get vectorOfStrongReferrables => const fb.ListReader<Referrable>(Referrable.reader).vTableGetNullable(_bc, _bcOffset, 80);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001232 int get coOwningReference => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 82, 0);
James Kuszmaul8e62b022022-03-22 09:33:25 -07001233 List<int>? get vectorOfCoOwningReferences => const fb.ListReader<int>(fb.Uint64Reader()).vTableGetNullable(_bc, _bcOffset, 84);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001234 int get nonOwningReference => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 86, 0);
James Kuszmaul8e62b022022-03-22 09:33:25 -07001235 List<int>? get vectorOfNonOwningReferences => const fb.ListReader<int>(fb.Uint64Reader()).vTableGetNullable(_bc, _bcOffset, 88);
1236 AnyUniqueAliasesTypeId? get anyUniqueType => AnyUniqueAliasesTypeId._createOrNull(const fb.Uint8Reader().vTableGetNullable(_bc, _bcOffset, 90));
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001237 dynamic get anyUnique {
1238 switch (anyUniqueType?.value) {
James Kuszmaul8e62b022022-03-22 09:33:25 -07001239 case 1: return Monster.reader.vTableGetNullable(_bc, _bcOffset, 92);
1240 case 2: return TestSimpleTableWithEnum.reader.vTableGetNullable(_bc, _bcOffset, 92);
1241 case 3: return my_game_example2.Monster.reader.vTableGetNullable(_bc, _bcOffset, 92);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001242 default: return null;
1243 }
1244 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001245 AnyAmbiguousAliasesTypeId? get anyAmbiguousType => AnyAmbiguousAliasesTypeId._createOrNull(const fb.Uint8Reader().vTableGetNullable(_bc, _bcOffset, 94));
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001246 dynamic get anyAmbiguous {
1247 switch (anyAmbiguousType?.value) {
James Kuszmaul8e62b022022-03-22 09:33:25 -07001248 case 1: return Monster.reader.vTableGetNullable(_bc, _bcOffset, 96);
1249 case 2: return Monster.reader.vTableGetNullable(_bc, _bcOffset, 96);
1250 case 3: return Monster.reader.vTableGetNullable(_bc, _bcOffset, 96);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001251 default: return null;
1252 }
1253 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001254 List<Color>? get vectorOfEnums => const fb.ListReader<Color>(Color.reader).vTableGetNullable(_bc, _bcOffset, 98);
1255 Race get signedEnum => Race.fromValue(const fb.Int8Reader().vTableGet(_bc, _bcOffset, 100, -1));
1256 List<int>? get testrequirednestedflatbuffer => const fb.Uint8ListReader().vTableGetNullable(_bc, _bcOffset, 102);
1257 List<Stat>? get scalarKeySortedTables => const fb.ListReader<Stat>(Stat.reader).vTableGetNullable(_bc, _bcOffset, 104);
1258 Test? get nativeInline => Test.reader.vTableGetNullable(_bc, _bcOffset, 106);
1259 LongEnum get longEnumNonEnumDefault => LongEnum.fromValue(const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 108, 0));
1260 LongEnum get longEnumNormalDefault => LongEnum.fromValue(const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 110, 2));
James Kuszmaul3b15b0c2022-11-08 14:03:16 -08001261 double get nanDefault => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 112, double.nan);
1262 double get infDefault => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 114, double.infinity);
1263 double get positiveInfDefault => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 116, double.infinity);
1264 double get infinityDefault => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 118, double.infinity);
1265 double get positiveInfinityDefault => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 120, double.infinity);
1266 double get negativeInfDefault => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 122, double.negativeInfinity);
1267 double get negativeInfinityDefault => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 124, double.negativeInfinity);
1268 double get doubleInfDefault => const fb.Float64Reader().vTableGet(_bc, _bcOffset, 126, double.infinity);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001269
1270 @override
1271 String toString() {
James Kuszmaul3b15b0c2022-11-08 14:03:16 -08001272 return 'Monster{pos: ${pos}, mana: ${mana}, hp: ${hp}, name: ${name}, inventory: ${inventory}, color: ${color}, testType: ${testType}, test: ${test}, test4: ${test4}, testarrayofstring: ${testarrayofstring}, testarrayoftables: ${testarrayoftables}, enemy: ${enemy}, testnestedflatbuffer: ${testnestedflatbuffer}, testempty: ${testempty}, testbool: ${testbool}, testhashs32Fnv1: ${testhashs32Fnv1}, testhashu32Fnv1: ${testhashu32Fnv1}, testhashs64Fnv1: ${testhashs64Fnv1}, testhashu64Fnv1: ${testhashu64Fnv1}, testhashs32Fnv1a: ${testhashs32Fnv1a}, testhashu32Fnv1a: ${testhashu32Fnv1a}, testhashs64Fnv1a: ${testhashs64Fnv1a}, testhashu64Fnv1a: ${testhashu64Fnv1a}, testarrayofbools: ${testarrayofbools}, testf: ${testf}, testf2: ${testf2}, testf3: ${testf3}, testarrayofstring2: ${testarrayofstring2}, testarrayofsortedstruct: ${testarrayofsortedstruct}, flex: ${flex}, test5: ${test5}, vectorOfLongs: ${vectorOfLongs}, vectorOfDoubles: ${vectorOfDoubles}, parentNamespaceTest: ${parentNamespaceTest}, vectorOfReferrables: ${vectorOfReferrables}, singleWeakReference: ${singleWeakReference}, vectorOfWeakReferences: ${vectorOfWeakReferences}, vectorOfStrongReferrables: ${vectorOfStrongReferrables}, coOwningReference: ${coOwningReference}, vectorOfCoOwningReferences: ${vectorOfCoOwningReferences}, nonOwningReference: ${nonOwningReference}, vectorOfNonOwningReferences: ${vectorOfNonOwningReferences}, anyUniqueType: ${anyUniqueType}, anyUnique: ${anyUnique}, anyAmbiguousType: ${anyAmbiguousType}, anyAmbiguous: ${anyAmbiguous}, vectorOfEnums: ${vectorOfEnums}, signedEnum: ${signedEnum}, testrequirednestedflatbuffer: ${testrequirednestedflatbuffer}, scalarKeySortedTables: ${scalarKeySortedTables}, nativeInline: ${nativeInline}, longEnumNonEnumDefault: ${longEnumNonEnumDefault}, longEnumNormalDefault: ${longEnumNormalDefault}, nanDefault: ${nanDefault}, infDefault: ${infDefault}, positiveInfDefault: ${positiveInfDefault}, infinityDefault: ${infinityDefault}, positiveInfinityDefault: ${positiveInfinityDefault}, negativeInfDefault: ${negativeInfDefault}, negativeInfinityDefault: ${negativeInfinityDefault}, doubleInfDefault: ${doubleInfDefault}}';
James Kuszmaul8e62b022022-03-22 09:33:25 -07001273 }
1274
1275 MonsterT unpack() => MonsterT(
1276 pos: pos?.unpack(),
1277 mana: mana,
1278 hp: hp,
1279 name: name,
1280 inventory: const fb.Uint8ListReader(lazy: false).vTableGetNullable(_bc, _bcOffset, 14),
1281 color: color,
1282 testType: testType,
1283 test: test,
1284 test4: test4?.map((e) => e.unpack()).toList(),
1285 testarrayofstring: const fb.ListReader<String>(fb.StringReader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 24),
1286 testarrayoftables: testarrayoftables?.map((e) => e.unpack()).toList(),
1287 enemy: enemy?.unpack(),
1288 testnestedflatbuffer: const fb.Uint8ListReader(lazy: false).vTableGetNullable(_bc, _bcOffset, 30),
1289 testempty: testempty?.unpack(),
1290 testbool: testbool,
1291 testhashs32Fnv1: testhashs32Fnv1,
1292 testhashu32Fnv1: testhashu32Fnv1,
1293 testhashs64Fnv1: testhashs64Fnv1,
1294 testhashu64Fnv1: testhashu64Fnv1,
1295 testhashs32Fnv1a: testhashs32Fnv1a,
1296 testhashu32Fnv1a: testhashu32Fnv1a,
1297 testhashs64Fnv1a: testhashs64Fnv1a,
1298 testhashu64Fnv1a: testhashu64Fnv1a,
1299 testarrayofbools: const fb.ListReader<bool>(fb.BoolReader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 52),
1300 testf: testf,
1301 testf2: testf2,
1302 testf3: testf3,
1303 testarrayofstring2: const fb.ListReader<String>(fb.StringReader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 60),
1304 testarrayofsortedstruct: testarrayofsortedstruct?.map((e) => e.unpack()).toList(),
1305 flex: const fb.Uint8ListReader(lazy: false).vTableGetNullable(_bc, _bcOffset, 64),
1306 test5: test5?.map((e) => e.unpack()).toList(),
1307 vectorOfLongs: const fb.ListReader<int>(fb.Int64Reader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 68),
1308 vectorOfDoubles: const fb.ListReader<double>(fb.Float64Reader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 70),
1309 parentNamespaceTest: parentNamespaceTest?.unpack(),
1310 vectorOfReferrables: vectorOfReferrables?.map((e) => e.unpack()).toList(),
1311 singleWeakReference: singleWeakReference,
1312 vectorOfWeakReferences: const fb.ListReader<int>(fb.Uint64Reader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 78),
1313 vectorOfStrongReferrables: vectorOfStrongReferrables?.map((e) => e.unpack()).toList(),
1314 coOwningReference: coOwningReference,
1315 vectorOfCoOwningReferences: const fb.ListReader<int>(fb.Uint64Reader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 84),
1316 nonOwningReference: nonOwningReference,
1317 vectorOfNonOwningReferences: const fb.ListReader<int>(fb.Uint64Reader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 88),
1318 anyUniqueType: anyUniqueType,
1319 anyUnique: anyUnique,
1320 anyAmbiguousType: anyAmbiguousType,
1321 anyAmbiguous: anyAmbiguous,
1322 vectorOfEnums: const fb.ListReader<Color>(Color.reader, lazy: false).vTableGetNullable(_bc, _bcOffset, 98),
1323 signedEnum: signedEnum,
1324 testrequirednestedflatbuffer: const fb.Uint8ListReader(lazy: false).vTableGetNullable(_bc, _bcOffset, 102),
1325 scalarKeySortedTables: scalarKeySortedTables?.map((e) => e.unpack()).toList(),
1326 nativeInline: nativeInline?.unpack(),
1327 longEnumNonEnumDefault: longEnumNonEnumDefault,
James Kuszmaul3b15b0c2022-11-08 14:03:16 -08001328 longEnumNormalDefault: longEnumNormalDefault,
1329 nanDefault: nanDefault,
1330 infDefault: infDefault,
1331 positiveInfDefault: positiveInfDefault,
1332 infinityDefault: infinityDefault,
1333 positiveInfinityDefault: positiveInfinityDefault,
1334 negativeInfDefault: negativeInfDefault,
1335 negativeInfinityDefault: negativeInfinityDefault,
1336 doubleInfDefault: doubleInfDefault);
James Kuszmaul8e62b022022-03-22 09:33:25 -07001337
1338 static int pack(fb.Builder fbBuilder, MonsterT? object) {
1339 if (object == null) return 0;
1340 return object.pack(fbBuilder);
1341 }
1342}
1343
1344/// an example documentation comment: "monster object"
1345class MonsterT implements fb.Packable {
1346 Vec3T? pos;
1347 int mana;
1348 int hp;
1349 String? name;
1350 List<int>? inventory;
1351 Color color;
1352 AnyTypeId? testType;
1353 dynamic test;
1354 List<TestT>? test4;
1355 List<String>? testarrayofstring;
1356 /// an example documentation comment: this will end up in the generated code
1357 /// multiline too
1358 List<MonsterT>? testarrayoftables;
1359 MonsterT? enemy;
1360 List<int>? testnestedflatbuffer;
1361 StatT? testempty;
1362 bool testbool;
1363 int testhashs32Fnv1;
1364 int testhashu32Fnv1;
1365 int testhashs64Fnv1;
1366 int testhashu64Fnv1;
1367 int testhashs32Fnv1a;
1368 int testhashu32Fnv1a;
1369 int testhashs64Fnv1a;
1370 int testhashu64Fnv1a;
1371 List<bool>? testarrayofbools;
1372 double testf;
1373 double testf2;
1374 double testf3;
1375 List<String>? testarrayofstring2;
1376 List<AbilityT>? testarrayofsortedstruct;
1377 List<int>? flex;
1378 List<TestT>? test5;
1379 List<int>? vectorOfLongs;
1380 List<double>? vectorOfDoubles;
1381 my_game.InParentNamespaceT? parentNamespaceTest;
1382 List<ReferrableT>? vectorOfReferrables;
1383 int singleWeakReference;
1384 List<int>? vectorOfWeakReferences;
1385 List<ReferrableT>? vectorOfStrongReferrables;
1386 int coOwningReference;
1387 List<int>? vectorOfCoOwningReferences;
1388 int nonOwningReference;
1389 List<int>? vectorOfNonOwningReferences;
1390 AnyUniqueAliasesTypeId? anyUniqueType;
1391 dynamic anyUnique;
1392 AnyAmbiguousAliasesTypeId? anyAmbiguousType;
1393 dynamic anyAmbiguous;
1394 List<Color>? vectorOfEnums;
1395 Race signedEnum;
1396 List<int>? testrequirednestedflatbuffer;
1397 List<StatT>? scalarKeySortedTables;
1398 TestT? nativeInline;
1399 LongEnum longEnumNonEnumDefault;
1400 LongEnum longEnumNormalDefault;
James Kuszmaul3b15b0c2022-11-08 14:03:16 -08001401 double nanDefault;
1402 double infDefault;
1403 double positiveInfDefault;
1404 double infinityDefault;
1405 double positiveInfinityDefault;
1406 double negativeInfDefault;
1407 double negativeInfinityDefault;
1408 double doubleInfDefault;
James Kuszmaul8e62b022022-03-22 09:33:25 -07001409
1410 MonsterT({
1411 this.pos,
1412 this.mana = 150,
1413 this.hp = 100,
1414 this.name,
1415 this.inventory,
1416 this.color = Color.Blue,
1417 this.testType,
1418 this.test,
1419 this.test4,
1420 this.testarrayofstring,
1421 this.testarrayoftables,
1422 this.enemy,
1423 this.testnestedflatbuffer,
1424 this.testempty,
1425 this.testbool = false,
1426 this.testhashs32Fnv1 = 0,
1427 this.testhashu32Fnv1 = 0,
1428 this.testhashs64Fnv1 = 0,
1429 this.testhashu64Fnv1 = 0,
1430 this.testhashs32Fnv1a = 0,
1431 this.testhashu32Fnv1a = 0,
1432 this.testhashs64Fnv1a = 0,
1433 this.testhashu64Fnv1a = 0,
1434 this.testarrayofbools,
1435 this.testf = 3.14159,
1436 this.testf2 = 3.0,
1437 this.testf3 = 0.0,
1438 this.testarrayofstring2,
1439 this.testarrayofsortedstruct,
1440 this.flex,
1441 this.test5,
1442 this.vectorOfLongs,
1443 this.vectorOfDoubles,
1444 this.parentNamespaceTest,
1445 this.vectorOfReferrables,
1446 this.singleWeakReference = 0,
1447 this.vectorOfWeakReferences,
1448 this.vectorOfStrongReferrables,
1449 this.coOwningReference = 0,
1450 this.vectorOfCoOwningReferences,
1451 this.nonOwningReference = 0,
1452 this.vectorOfNonOwningReferences,
1453 this.anyUniqueType,
1454 this.anyUnique,
1455 this.anyAmbiguousType,
1456 this.anyAmbiguous,
1457 this.vectorOfEnums,
1458 this.signedEnum = Race.None,
1459 this.testrequirednestedflatbuffer,
1460 this.scalarKeySortedTables,
1461 this.nativeInline,
1462 this.longEnumNonEnumDefault = const LongEnum._(0),
James Kuszmaul3b15b0c2022-11-08 14:03:16 -08001463 this.longEnumNormalDefault = LongEnum.LongOne,
1464 this.nanDefault = double.nan,
1465 this.infDefault = double.infinity,
1466 this.positiveInfDefault = double.infinity,
1467 this.infinityDefault = double.infinity,
1468 this.positiveInfinityDefault = double.infinity,
1469 this.negativeInfDefault = double.negativeInfinity,
1470 this.negativeInfinityDefault = double.negativeInfinity,
1471 this.doubleInfDefault = double.infinity});
James Kuszmaul8e62b022022-03-22 09:33:25 -07001472
1473 @override
1474 int pack(fb.Builder fbBuilder) {
1475 final int? nameOffset = name == null ? null
1476 : fbBuilder.writeString(name!);
1477 final int? inventoryOffset = inventory == null ? null
1478 : fbBuilder.writeListUint8(inventory!);
1479 final int? testOffset = test?.pack(fbBuilder);
1480 int? test4Offset;
1481 if (test4 != null) {
1482 for (var e in test4!) { e.pack(fbBuilder); }
1483 test4Offset = fbBuilder.endStructVector(test4!.length);
1484 }
1485 final int? testarrayofstringOffset = testarrayofstring == null ? null
1486 : fbBuilder.writeList(testarrayofstring!.map(fbBuilder.writeString).toList());
1487 final int? testarrayoftablesOffset = testarrayoftables == null ? null
1488 : fbBuilder.writeList(testarrayoftables!.map((b) => b.pack(fbBuilder)).toList());
1489 final int? enemyOffset = enemy?.pack(fbBuilder);
1490 final int? testnestedflatbufferOffset = testnestedflatbuffer == null ? null
1491 : fbBuilder.writeListUint8(testnestedflatbuffer!);
1492 final int? testemptyOffset = testempty?.pack(fbBuilder);
1493 final int? testarrayofboolsOffset = testarrayofbools == null ? null
1494 : fbBuilder.writeListBool(testarrayofbools!);
1495 final int? testarrayofstring2Offset = testarrayofstring2 == null ? null
1496 : fbBuilder.writeList(testarrayofstring2!.map(fbBuilder.writeString).toList());
1497 int? testarrayofsortedstructOffset;
1498 if (testarrayofsortedstruct != null) {
1499 for (var e in testarrayofsortedstruct!) { e.pack(fbBuilder); }
1500 testarrayofsortedstructOffset = fbBuilder.endStructVector(testarrayofsortedstruct!.length);
1501 }
1502 final int? flexOffset = flex == null ? null
1503 : fbBuilder.writeListUint8(flex!);
1504 int? test5Offset;
1505 if (test5 != null) {
1506 for (var e in test5!) { e.pack(fbBuilder); }
1507 test5Offset = fbBuilder.endStructVector(test5!.length);
1508 }
1509 final int? vectorOfLongsOffset = vectorOfLongs == null ? null
1510 : fbBuilder.writeListInt64(vectorOfLongs!);
1511 final int? vectorOfDoublesOffset = vectorOfDoubles == null ? null
1512 : fbBuilder.writeListFloat64(vectorOfDoubles!);
1513 final int? parentNamespaceTestOffset = parentNamespaceTest?.pack(fbBuilder);
1514 final int? vectorOfReferrablesOffset = vectorOfReferrables == null ? null
1515 : fbBuilder.writeList(vectorOfReferrables!.map((b) => b.pack(fbBuilder)).toList());
1516 final int? vectorOfWeakReferencesOffset = vectorOfWeakReferences == null ? null
1517 : fbBuilder.writeListUint64(vectorOfWeakReferences!);
1518 final int? vectorOfStrongReferrablesOffset = vectorOfStrongReferrables == null ? null
1519 : fbBuilder.writeList(vectorOfStrongReferrables!.map((b) => b.pack(fbBuilder)).toList());
1520 final int? vectorOfCoOwningReferencesOffset = vectorOfCoOwningReferences == null ? null
1521 : fbBuilder.writeListUint64(vectorOfCoOwningReferences!);
1522 final int? vectorOfNonOwningReferencesOffset = vectorOfNonOwningReferences == null ? null
1523 : fbBuilder.writeListUint64(vectorOfNonOwningReferences!);
1524 final int? anyUniqueOffset = anyUnique?.pack(fbBuilder);
1525 final int? anyAmbiguousOffset = anyAmbiguous?.pack(fbBuilder);
1526 final int? vectorOfEnumsOffset = vectorOfEnums == null ? null
1527 : fbBuilder.writeListUint8(vectorOfEnums!.map((f) => f.value).toList());
1528 final int? testrequirednestedflatbufferOffset = testrequirednestedflatbuffer == null ? null
1529 : fbBuilder.writeListUint8(testrequirednestedflatbuffer!);
1530 final int? scalarKeySortedTablesOffset = scalarKeySortedTables == null ? null
1531 : fbBuilder.writeList(scalarKeySortedTables!.map((b) => b.pack(fbBuilder)).toList());
James Kuszmaul3b15b0c2022-11-08 14:03:16 -08001532 fbBuilder.startTable(62);
James Kuszmaul8e62b022022-03-22 09:33:25 -07001533 if (pos != null) {
1534 fbBuilder.addStruct(0, pos!.pack(fbBuilder));
1535 }
1536 fbBuilder.addInt16(1, mana);
1537 fbBuilder.addInt16(2, hp);
1538 fbBuilder.addOffset(3, nameOffset);
1539 fbBuilder.addOffset(5, inventoryOffset);
1540 fbBuilder.addUint8(6, color.value);
1541 fbBuilder.addUint8(7, testType?.value);
1542 fbBuilder.addOffset(8, testOffset);
1543 fbBuilder.addOffset(9, test4Offset);
1544 fbBuilder.addOffset(10, testarrayofstringOffset);
1545 fbBuilder.addOffset(11, testarrayoftablesOffset);
1546 fbBuilder.addOffset(12, enemyOffset);
1547 fbBuilder.addOffset(13, testnestedflatbufferOffset);
1548 fbBuilder.addOffset(14, testemptyOffset);
1549 fbBuilder.addBool(15, testbool);
1550 fbBuilder.addInt32(16, testhashs32Fnv1);
1551 fbBuilder.addUint32(17, testhashu32Fnv1);
1552 fbBuilder.addInt64(18, testhashs64Fnv1);
1553 fbBuilder.addUint64(19, testhashu64Fnv1);
1554 fbBuilder.addInt32(20, testhashs32Fnv1a);
1555 fbBuilder.addUint32(21, testhashu32Fnv1a);
1556 fbBuilder.addInt64(22, testhashs64Fnv1a);
1557 fbBuilder.addUint64(23, testhashu64Fnv1a);
1558 fbBuilder.addOffset(24, testarrayofboolsOffset);
1559 fbBuilder.addFloat32(25, testf);
1560 fbBuilder.addFloat32(26, testf2);
1561 fbBuilder.addFloat32(27, testf3);
1562 fbBuilder.addOffset(28, testarrayofstring2Offset);
1563 fbBuilder.addOffset(29, testarrayofsortedstructOffset);
1564 fbBuilder.addOffset(30, flexOffset);
1565 fbBuilder.addOffset(31, test5Offset);
1566 fbBuilder.addOffset(32, vectorOfLongsOffset);
1567 fbBuilder.addOffset(33, vectorOfDoublesOffset);
1568 fbBuilder.addOffset(34, parentNamespaceTestOffset);
1569 fbBuilder.addOffset(35, vectorOfReferrablesOffset);
1570 fbBuilder.addUint64(36, singleWeakReference);
1571 fbBuilder.addOffset(37, vectorOfWeakReferencesOffset);
1572 fbBuilder.addOffset(38, vectorOfStrongReferrablesOffset);
1573 fbBuilder.addUint64(39, coOwningReference);
1574 fbBuilder.addOffset(40, vectorOfCoOwningReferencesOffset);
1575 fbBuilder.addUint64(41, nonOwningReference);
1576 fbBuilder.addOffset(42, vectorOfNonOwningReferencesOffset);
1577 fbBuilder.addUint8(43, anyUniqueType?.value);
1578 fbBuilder.addOffset(44, anyUniqueOffset);
1579 fbBuilder.addUint8(45, anyAmbiguousType?.value);
1580 fbBuilder.addOffset(46, anyAmbiguousOffset);
1581 fbBuilder.addOffset(47, vectorOfEnumsOffset);
1582 fbBuilder.addInt8(48, signedEnum.value);
1583 fbBuilder.addOffset(49, testrequirednestedflatbufferOffset);
1584 fbBuilder.addOffset(50, scalarKeySortedTablesOffset);
1585 if (nativeInline != null) {
1586 fbBuilder.addStruct(51, nativeInline!.pack(fbBuilder));
1587 }
1588 fbBuilder.addUint64(52, longEnumNonEnumDefault.value);
1589 fbBuilder.addUint64(53, longEnumNormalDefault.value);
James Kuszmaul3b15b0c2022-11-08 14:03:16 -08001590 fbBuilder.addFloat32(54, nanDefault);
1591 fbBuilder.addFloat32(55, infDefault);
1592 fbBuilder.addFloat32(56, positiveInfDefault);
1593 fbBuilder.addFloat32(57, infinityDefault);
1594 fbBuilder.addFloat32(58, positiveInfinityDefault);
1595 fbBuilder.addFloat32(59, negativeInfDefault);
1596 fbBuilder.addFloat32(60, negativeInfinityDefault);
1597 fbBuilder.addFloat64(61, doubleInfDefault);
James Kuszmaul8e62b022022-03-22 09:33:25 -07001598 return fbBuilder.endTable();
1599 }
1600
1601 @override
1602 String toString() {
James Kuszmaul3b15b0c2022-11-08 14:03:16 -08001603 return 'MonsterT{pos: ${pos}, mana: ${mana}, hp: ${hp}, name: ${name}, inventory: ${inventory}, color: ${color}, testType: ${testType}, test: ${test}, test4: ${test4}, testarrayofstring: ${testarrayofstring}, testarrayoftables: ${testarrayoftables}, enemy: ${enemy}, testnestedflatbuffer: ${testnestedflatbuffer}, testempty: ${testempty}, testbool: ${testbool}, testhashs32Fnv1: ${testhashs32Fnv1}, testhashu32Fnv1: ${testhashu32Fnv1}, testhashs64Fnv1: ${testhashs64Fnv1}, testhashu64Fnv1: ${testhashu64Fnv1}, testhashs32Fnv1a: ${testhashs32Fnv1a}, testhashu32Fnv1a: ${testhashu32Fnv1a}, testhashs64Fnv1a: ${testhashs64Fnv1a}, testhashu64Fnv1a: ${testhashu64Fnv1a}, testarrayofbools: ${testarrayofbools}, testf: ${testf}, testf2: ${testf2}, testf3: ${testf3}, testarrayofstring2: ${testarrayofstring2}, testarrayofsortedstruct: ${testarrayofsortedstruct}, flex: ${flex}, test5: ${test5}, vectorOfLongs: ${vectorOfLongs}, vectorOfDoubles: ${vectorOfDoubles}, parentNamespaceTest: ${parentNamespaceTest}, vectorOfReferrables: ${vectorOfReferrables}, singleWeakReference: ${singleWeakReference}, vectorOfWeakReferences: ${vectorOfWeakReferences}, vectorOfStrongReferrables: ${vectorOfStrongReferrables}, coOwningReference: ${coOwningReference}, vectorOfCoOwningReferences: ${vectorOfCoOwningReferences}, nonOwningReference: ${nonOwningReference}, vectorOfNonOwningReferences: ${vectorOfNonOwningReferences}, anyUniqueType: ${anyUniqueType}, anyUnique: ${anyUnique}, anyAmbiguousType: ${anyAmbiguousType}, anyAmbiguous: ${anyAmbiguous}, vectorOfEnums: ${vectorOfEnums}, signedEnum: ${signedEnum}, testrequirednestedflatbuffer: ${testrequirednestedflatbuffer}, scalarKeySortedTables: ${scalarKeySortedTables}, nativeInline: ${nativeInline}, longEnumNonEnumDefault: ${longEnumNonEnumDefault}, longEnumNormalDefault: ${longEnumNormalDefault}, nanDefault: ${nanDefault}, infDefault: ${infDefault}, positiveInfDefault: ${positiveInfDefault}, infinityDefault: ${infinityDefault}, positiveInfinityDefault: ${positiveInfinityDefault}, negativeInfDefault: ${negativeInfDefault}, negativeInfinityDefault: ${negativeInfinityDefault}, doubleInfDefault: ${doubleInfDefault}}';
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001604 }
1605}
1606
1607class _MonsterReader extends fb.TableReader<Monster> {
1608 const _MonsterReader();
1609
1610 @override
1611 Monster createObject(fb.BufferContext bc, int offset) =>
James Kuszmaul8e62b022022-03-22 09:33:25 -07001612 Monster._(bc, offset);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001613}
1614
1615class MonsterBuilder {
James Kuszmaul8e62b022022-03-22 09:33:25 -07001616 MonsterBuilder(this.fbBuilder);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001617
1618 final fb.Builder fbBuilder;
1619
1620 void begin() {
James Kuszmaul3b15b0c2022-11-08 14:03:16 -08001621 fbBuilder.startTable(62);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001622 }
1623
1624 int addPos(int offset) {
1625 fbBuilder.addStruct(0, offset);
1626 return fbBuilder.offset;
1627 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001628 int addMana(int? mana) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001629 fbBuilder.addInt16(1, mana);
1630 return fbBuilder.offset;
1631 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001632 int addHp(int? hp) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001633 fbBuilder.addInt16(2, hp);
1634 return fbBuilder.offset;
1635 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001636 int addNameOffset(int? offset) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001637 fbBuilder.addOffset(3, offset);
1638 return fbBuilder.offset;
1639 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001640 int addInventoryOffset(int? offset) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001641 fbBuilder.addOffset(5, offset);
1642 return fbBuilder.offset;
1643 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001644 int addColor(Color? color) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001645 fbBuilder.addUint8(6, color?.value);
1646 return fbBuilder.offset;
1647 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001648 int addTestType(AnyTypeId? testType) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001649 fbBuilder.addUint8(7, testType?.value);
1650 return fbBuilder.offset;
1651 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001652 int addTestOffset(int? offset) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001653 fbBuilder.addOffset(8, offset);
1654 return fbBuilder.offset;
1655 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001656 int addTest4Offset(int? offset) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001657 fbBuilder.addOffset(9, offset);
1658 return fbBuilder.offset;
1659 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001660 int addTestarrayofstringOffset(int? offset) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001661 fbBuilder.addOffset(10, offset);
1662 return fbBuilder.offset;
1663 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001664 int addTestarrayoftablesOffset(int? offset) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001665 fbBuilder.addOffset(11, offset);
1666 return fbBuilder.offset;
1667 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001668 int addEnemyOffset(int? offset) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001669 fbBuilder.addOffset(12, offset);
1670 return fbBuilder.offset;
1671 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001672 int addTestnestedflatbufferOffset(int? offset) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001673 fbBuilder.addOffset(13, offset);
1674 return fbBuilder.offset;
1675 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001676 int addTestemptyOffset(int? offset) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001677 fbBuilder.addOffset(14, offset);
1678 return fbBuilder.offset;
1679 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001680 int addTestbool(bool? testbool) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001681 fbBuilder.addBool(15, testbool);
1682 return fbBuilder.offset;
1683 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001684 int addTesthashs32Fnv1(int? testhashs32Fnv1) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001685 fbBuilder.addInt32(16, testhashs32Fnv1);
1686 return fbBuilder.offset;
1687 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001688 int addTesthashu32Fnv1(int? testhashu32Fnv1) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001689 fbBuilder.addUint32(17, testhashu32Fnv1);
1690 return fbBuilder.offset;
1691 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001692 int addTesthashs64Fnv1(int? testhashs64Fnv1) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001693 fbBuilder.addInt64(18, testhashs64Fnv1);
1694 return fbBuilder.offset;
1695 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001696 int addTesthashu64Fnv1(int? testhashu64Fnv1) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001697 fbBuilder.addUint64(19, testhashu64Fnv1);
1698 return fbBuilder.offset;
1699 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001700 int addTesthashs32Fnv1a(int? testhashs32Fnv1a) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001701 fbBuilder.addInt32(20, testhashs32Fnv1a);
1702 return fbBuilder.offset;
1703 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001704 int addTesthashu32Fnv1a(int? testhashu32Fnv1a) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001705 fbBuilder.addUint32(21, testhashu32Fnv1a);
1706 return fbBuilder.offset;
1707 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001708 int addTesthashs64Fnv1a(int? testhashs64Fnv1a) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001709 fbBuilder.addInt64(22, testhashs64Fnv1a);
1710 return fbBuilder.offset;
1711 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001712 int addTesthashu64Fnv1a(int? testhashu64Fnv1a) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001713 fbBuilder.addUint64(23, testhashu64Fnv1a);
1714 return fbBuilder.offset;
1715 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001716 int addTestarrayofboolsOffset(int? offset) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001717 fbBuilder.addOffset(24, offset);
1718 return fbBuilder.offset;
1719 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001720 int addTestf(double? testf) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001721 fbBuilder.addFloat32(25, testf);
1722 return fbBuilder.offset;
1723 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001724 int addTestf2(double? testf2) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001725 fbBuilder.addFloat32(26, testf2);
1726 return fbBuilder.offset;
1727 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001728 int addTestf3(double? testf3) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001729 fbBuilder.addFloat32(27, testf3);
1730 return fbBuilder.offset;
1731 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001732 int addTestarrayofstring2Offset(int? offset) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001733 fbBuilder.addOffset(28, offset);
1734 return fbBuilder.offset;
1735 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001736 int addTestarrayofsortedstructOffset(int? offset) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001737 fbBuilder.addOffset(29, offset);
1738 return fbBuilder.offset;
1739 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001740 int addFlexOffset(int? offset) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001741 fbBuilder.addOffset(30, offset);
1742 return fbBuilder.offset;
1743 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001744 int addTest5Offset(int? offset) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001745 fbBuilder.addOffset(31, offset);
1746 return fbBuilder.offset;
1747 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001748 int addVectorOfLongsOffset(int? offset) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001749 fbBuilder.addOffset(32, offset);
1750 return fbBuilder.offset;
1751 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001752 int addVectorOfDoublesOffset(int? offset) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001753 fbBuilder.addOffset(33, offset);
1754 return fbBuilder.offset;
1755 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001756 int addParentNamespaceTestOffset(int? offset) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001757 fbBuilder.addOffset(34, offset);
1758 return fbBuilder.offset;
1759 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001760 int addVectorOfReferrablesOffset(int? offset) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001761 fbBuilder.addOffset(35, offset);
1762 return fbBuilder.offset;
1763 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001764 int addSingleWeakReference(int? singleWeakReference) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001765 fbBuilder.addUint64(36, singleWeakReference);
1766 return fbBuilder.offset;
1767 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001768 int addVectorOfWeakReferencesOffset(int? offset) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001769 fbBuilder.addOffset(37, offset);
1770 return fbBuilder.offset;
1771 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001772 int addVectorOfStrongReferrablesOffset(int? offset) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001773 fbBuilder.addOffset(38, offset);
1774 return fbBuilder.offset;
1775 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001776 int addCoOwningReference(int? coOwningReference) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001777 fbBuilder.addUint64(39, coOwningReference);
1778 return fbBuilder.offset;
1779 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001780 int addVectorOfCoOwningReferencesOffset(int? offset) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001781 fbBuilder.addOffset(40, offset);
1782 return fbBuilder.offset;
1783 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001784 int addNonOwningReference(int? nonOwningReference) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001785 fbBuilder.addUint64(41, nonOwningReference);
1786 return fbBuilder.offset;
1787 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001788 int addVectorOfNonOwningReferencesOffset(int? offset) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001789 fbBuilder.addOffset(42, offset);
1790 return fbBuilder.offset;
1791 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001792 int addAnyUniqueType(AnyUniqueAliasesTypeId? anyUniqueType) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001793 fbBuilder.addUint8(43, anyUniqueType?.value);
1794 return fbBuilder.offset;
1795 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001796 int addAnyUniqueOffset(int? offset) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001797 fbBuilder.addOffset(44, offset);
1798 return fbBuilder.offset;
1799 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001800 int addAnyAmbiguousType(AnyAmbiguousAliasesTypeId? anyAmbiguousType) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001801 fbBuilder.addUint8(45, anyAmbiguousType?.value);
1802 return fbBuilder.offset;
1803 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001804 int addAnyAmbiguousOffset(int? offset) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001805 fbBuilder.addOffset(46, offset);
1806 return fbBuilder.offset;
1807 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001808 int addVectorOfEnumsOffset(int? offset) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001809 fbBuilder.addOffset(47, offset);
1810 return fbBuilder.offset;
1811 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001812 int addSignedEnum(Race? signedEnum) {
Austin Schuh272c6132020-11-14 16:37:52 -08001813 fbBuilder.addInt8(48, signedEnum?.value);
1814 return fbBuilder.offset;
1815 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001816 int addTestrequirednestedflatbufferOffset(int? offset) {
Austin Schuh272c6132020-11-14 16:37:52 -08001817 fbBuilder.addOffset(49, offset);
1818 return fbBuilder.offset;
1819 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001820 int addScalarKeySortedTablesOffset(int? offset) {
1821 fbBuilder.addOffset(50, offset);
1822 return fbBuilder.offset;
1823 }
1824 int addNativeInline(int offset) {
1825 fbBuilder.addStruct(51, offset);
1826 return fbBuilder.offset;
1827 }
1828 int addLongEnumNonEnumDefault(LongEnum? longEnumNonEnumDefault) {
1829 fbBuilder.addUint64(52, longEnumNonEnumDefault?.value);
1830 return fbBuilder.offset;
1831 }
1832 int addLongEnumNormalDefault(LongEnum? longEnumNormalDefault) {
1833 fbBuilder.addUint64(53, longEnumNormalDefault?.value);
1834 return fbBuilder.offset;
1835 }
James Kuszmaul3b15b0c2022-11-08 14:03:16 -08001836 int addNanDefault(double? nanDefault) {
1837 fbBuilder.addFloat32(54, nanDefault);
1838 return fbBuilder.offset;
1839 }
1840 int addInfDefault(double? infDefault) {
1841 fbBuilder.addFloat32(55, infDefault);
1842 return fbBuilder.offset;
1843 }
1844 int addPositiveInfDefault(double? positiveInfDefault) {
1845 fbBuilder.addFloat32(56, positiveInfDefault);
1846 return fbBuilder.offset;
1847 }
1848 int addInfinityDefault(double? infinityDefault) {
1849 fbBuilder.addFloat32(57, infinityDefault);
1850 return fbBuilder.offset;
1851 }
1852 int addPositiveInfinityDefault(double? positiveInfinityDefault) {
1853 fbBuilder.addFloat32(58, positiveInfinityDefault);
1854 return fbBuilder.offset;
1855 }
1856 int addNegativeInfDefault(double? negativeInfDefault) {
1857 fbBuilder.addFloat32(59, negativeInfDefault);
1858 return fbBuilder.offset;
1859 }
1860 int addNegativeInfinityDefault(double? negativeInfinityDefault) {
1861 fbBuilder.addFloat32(60, negativeInfinityDefault);
1862 return fbBuilder.offset;
1863 }
1864 int addDoubleInfDefault(double? doubleInfDefault) {
1865 fbBuilder.addFloat64(61, doubleInfDefault);
1866 return fbBuilder.offset;
1867 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001868
1869 int finish() {
1870 return fbBuilder.endTable();
1871 }
1872}
1873
1874class MonsterObjectBuilder extends fb.ObjectBuilder {
James Kuszmaul8e62b022022-03-22 09:33:25 -07001875 final Vec3ObjectBuilder? _pos;
1876 final int? _mana;
1877 final int? _hp;
1878 final String? _name;
1879 final List<int>? _inventory;
1880 final Color? _color;
1881 final AnyTypeId? _testType;
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001882 final dynamic _test;
James Kuszmaul8e62b022022-03-22 09:33:25 -07001883 final List<TestObjectBuilder>? _test4;
1884 final List<String>? _testarrayofstring;
1885 final List<MonsterObjectBuilder>? _testarrayoftables;
1886 final MonsterObjectBuilder? _enemy;
1887 final List<int>? _testnestedflatbuffer;
1888 final StatObjectBuilder? _testempty;
1889 final bool? _testbool;
1890 final int? _testhashs32Fnv1;
1891 final int? _testhashu32Fnv1;
1892 final int? _testhashs64Fnv1;
1893 final int? _testhashu64Fnv1;
1894 final int? _testhashs32Fnv1a;
1895 final int? _testhashu32Fnv1a;
1896 final int? _testhashs64Fnv1a;
1897 final int? _testhashu64Fnv1a;
1898 final List<bool>? _testarrayofbools;
1899 final double? _testf;
1900 final double? _testf2;
1901 final double? _testf3;
1902 final List<String>? _testarrayofstring2;
1903 final List<AbilityObjectBuilder>? _testarrayofsortedstruct;
1904 final List<int>? _flex;
1905 final List<TestObjectBuilder>? _test5;
1906 final List<int>? _vectorOfLongs;
1907 final List<double>? _vectorOfDoubles;
1908 final my_game.InParentNamespaceObjectBuilder? _parentNamespaceTest;
1909 final List<ReferrableObjectBuilder>? _vectorOfReferrables;
1910 final int? _singleWeakReference;
1911 final List<int>? _vectorOfWeakReferences;
1912 final List<ReferrableObjectBuilder>? _vectorOfStrongReferrables;
1913 final int? _coOwningReference;
1914 final List<int>? _vectorOfCoOwningReferences;
1915 final int? _nonOwningReference;
1916 final List<int>? _vectorOfNonOwningReferences;
1917 final AnyUniqueAliasesTypeId? _anyUniqueType;
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001918 final dynamic _anyUnique;
James Kuszmaul8e62b022022-03-22 09:33:25 -07001919 final AnyAmbiguousAliasesTypeId? _anyAmbiguousType;
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001920 final dynamic _anyAmbiguous;
James Kuszmaul8e62b022022-03-22 09:33:25 -07001921 final List<Color>? _vectorOfEnums;
1922 final Race? _signedEnum;
1923 final List<int>? _testrequirednestedflatbuffer;
1924 final List<StatObjectBuilder>? _scalarKeySortedTables;
1925 final TestObjectBuilder? _nativeInline;
1926 final LongEnum? _longEnumNonEnumDefault;
1927 final LongEnum? _longEnumNormalDefault;
James Kuszmaul3b15b0c2022-11-08 14:03:16 -08001928 final double? _nanDefault;
1929 final double? _infDefault;
1930 final double? _positiveInfDefault;
1931 final double? _infinityDefault;
1932 final double? _positiveInfinityDefault;
1933 final double? _negativeInfDefault;
1934 final double? _negativeInfinityDefault;
1935 final double? _doubleInfDefault;
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001936
1937 MonsterObjectBuilder({
James Kuszmaul8e62b022022-03-22 09:33:25 -07001938 Vec3ObjectBuilder? pos,
1939 int? mana,
1940 int? hp,
1941 String? name,
1942 List<int>? inventory,
1943 Color? color,
1944 AnyTypeId? testType,
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001945 dynamic test,
James Kuszmaul8e62b022022-03-22 09:33:25 -07001946 List<TestObjectBuilder>? test4,
1947 List<String>? testarrayofstring,
1948 List<MonsterObjectBuilder>? testarrayoftables,
1949 MonsterObjectBuilder? enemy,
1950 List<int>? testnestedflatbuffer,
1951 StatObjectBuilder? testempty,
1952 bool? testbool,
1953 int? testhashs32Fnv1,
1954 int? testhashu32Fnv1,
1955 int? testhashs64Fnv1,
1956 int? testhashu64Fnv1,
1957 int? testhashs32Fnv1a,
1958 int? testhashu32Fnv1a,
1959 int? testhashs64Fnv1a,
1960 int? testhashu64Fnv1a,
1961 List<bool>? testarrayofbools,
1962 double? testf,
1963 double? testf2,
1964 double? testf3,
1965 List<String>? testarrayofstring2,
1966 List<AbilityObjectBuilder>? testarrayofsortedstruct,
1967 List<int>? flex,
1968 List<TestObjectBuilder>? test5,
1969 List<int>? vectorOfLongs,
1970 List<double>? vectorOfDoubles,
1971 my_game.InParentNamespaceObjectBuilder? parentNamespaceTest,
1972 List<ReferrableObjectBuilder>? vectorOfReferrables,
1973 int? singleWeakReference,
1974 List<int>? vectorOfWeakReferences,
1975 List<ReferrableObjectBuilder>? vectorOfStrongReferrables,
1976 int? coOwningReference,
1977 List<int>? vectorOfCoOwningReferences,
1978 int? nonOwningReference,
1979 List<int>? vectorOfNonOwningReferences,
1980 AnyUniqueAliasesTypeId? anyUniqueType,
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001981 dynamic anyUnique,
James Kuszmaul8e62b022022-03-22 09:33:25 -07001982 AnyAmbiguousAliasesTypeId? anyAmbiguousType,
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001983 dynamic anyAmbiguous,
James Kuszmaul8e62b022022-03-22 09:33:25 -07001984 List<Color>? vectorOfEnums,
1985 Race? signedEnum,
1986 List<int>? testrequirednestedflatbuffer,
1987 List<StatObjectBuilder>? scalarKeySortedTables,
1988 TestObjectBuilder? nativeInline,
1989 LongEnum? longEnumNonEnumDefault,
1990 LongEnum? longEnumNormalDefault,
James Kuszmaul3b15b0c2022-11-08 14:03:16 -08001991 double? nanDefault,
1992 double? infDefault,
1993 double? positiveInfDefault,
1994 double? infinityDefault,
1995 double? positiveInfinityDefault,
1996 double? negativeInfDefault,
1997 double? negativeInfinityDefault,
1998 double? doubleInfDefault,
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001999 })
2000 : _pos = pos,
2001 _mana = mana,
2002 _hp = hp,
2003 _name = name,
2004 _inventory = inventory,
2005 _color = color,
2006 _testType = testType,
2007 _test = test,
2008 _test4 = test4,
2009 _testarrayofstring = testarrayofstring,
2010 _testarrayoftables = testarrayoftables,
2011 _enemy = enemy,
2012 _testnestedflatbuffer = testnestedflatbuffer,
2013 _testempty = testempty,
2014 _testbool = testbool,
2015 _testhashs32Fnv1 = testhashs32Fnv1,
2016 _testhashu32Fnv1 = testhashu32Fnv1,
2017 _testhashs64Fnv1 = testhashs64Fnv1,
2018 _testhashu64Fnv1 = testhashu64Fnv1,
2019 _testhashs32Fnv1a = testhashs32Fnv1a,
2020 _testhashu32Fnv1a = testhashu32Fnv1a,
2021 _testhashs64Fnv1a = testhashs64Fnv1a,
2022 _testhashu64Fnv1a = testhashu64Fnv1a,
2023 _testarrayofbools = testarrayofbools,
2024 _testf = testf,
2025 _testf2 = testf2,
2026 _testf3 = testf3,
2027 _testarrayofstring2 = testarrayofstring2,
2028 _testarrayofsortedstruct = testarrayofsortedstruct,
2029 _flex = flex,
2030 _test5 = test5,
2031 _vectorOfLongs = vectorOfLongs,
2032 _vectorOfDoubles = vectorOfDoubles,
2033 _parentNamespaceTest = parentNamespaceTest,
2034 _vectorOfReferrables = vectorOfReferrables,
2035 _singleWeakReference = singleWeakReference,
2036 _vectorOfWeakReferences = vectorOfWeakReferences,
2037 _vectorOfStrongReferrables = vectorOfStrongReferrables,
2038 _coOwningReference = coOwningReference,
2039 _vectorOfCoOwningReferences = vectorOfCoOwningReferences,
2040 _nonOwningReference = nonOwningReference,
2041 _vectorOfNonOwningReferences = vectorOfNonOwningReferences,
2042 _anyUniqueType = anyUniqueType,
2043 _anyUnique = anyUnique,
2044 _anyAmbiguousType = anyAmbiguousType,
2045 _anyAmbiguous = anyAmbiguous,
Austin Schuh272c6132020-11-14 16:37:52 -08002046 _vectorOfEnums = vectorOfEnums,
2047 _signedEnum = signedEnum,
James Kuszmaul8e62b022022-03-22 09:33:25 -07002048 _testrequirednestedflatbuffer = testrequirednestedflatbuffer,
2049 _scalarKeySortedTables = scalarKeySortedTables,
2050 _nativeInline = nativeInline,
2051 _longEnumNonEnumDefault = longEnumNonEnumDefault,
James Kuszmaul3b15b0c2022-11-08 14:03:16 -08002052 _longEnumNormalDefault = longEnumNormalDefault,
2053 _nanDefault = nanDefault,
2054 _infDefault = infDefault,
2055 _positiveInfDefault = positiveInfDefault,
2056 _infinityDefault = infinityDefault,
2057 _positiveInfinityDefault = positiveInfinityDefault,
2058 _negativeInfDefault = negativeInfDefault,
2059 _negativeInfinityDefault = negativeInfinityDefault,
2060 _doubleInfDefault = doubleInfDefault;
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002061
2062 /// Finish building, and store into the [fbBuilder].
2063 @override
James Kuszmaul8e62b022022-03-22 09:33:25 -07002064 int finish(fb.Builder fbBuilder) {
2065 final int? nameOffset = _name == null ? null
2066 : fbBuilder.writeString(_name!);
2067 final int? inventoryOffset = _inventory == null ? null
2068 : fbBuilder.writeListUint8(_inventory!);
2069 final int? testOffset = _test?.getOrCreateOffset(fbBuilder);
2070 final int? test4Offset = _test4 == null ? null
2071 : fbBuilder.writeListOfStructs(_test4!);
2072 final int? testarrayofstringOffset = _testarrayofstring == null ? null
2073 : fbBuilder.writeList(_testarrayofstring!.map(fbBuilder.writeString).toList());
2074 final int? testarrayoftablesOffset = _testarrayoftables == null ? null
2075 : fbBuilder.writeList(_testarrayoftables!.map((b) => b.getOrCreateOffset(fbBuilder)).toList());
2076 final int? enemyOffset = _enemy?.getOrCreateOffset(fbBuilder);
2077 final int? testnestedflatbufferOffset = _testnestedflatbuffer == null ? null
2078 : fbBuilder.writeListUint8(_testnestedflatbuffer!);
2079 final int? testemptyOffset = _testempty?.getOrCreateOffset(fbBuilder);
2080 final int? testarrayofboolsOffset = _testarrayofbools == null ? null
2081 : fbBuilder.writeListBool(_testarrayofbools!);
2082 final int? testarrayofstring2Offset = _testarrayofstring2 == null ? null
2083 : fbBuilder.writeList(_testarrayofstring2!.map(fbBuilder.writeString).toList());
2084 final int? testarrayofsortedstructOffset = _testarrayofsortedstruct == null ? null
2085 : fbBuilder.writeListOfStructs(_testarrayofsortedstruct!);
2086 final int? flexOffset = _flex == null ? null
2087 : fbBuilder.writeListUint8(_flex!);
2088 final int? test5Offset = _test5 == null ? null
2089 : fbBuilder.writeListOfStructs(_test5!);
2090 final int? vectorOfLongsOffset = _vectorOfLongs == null ? null
2091 : fbBuilder.writeListInt64(_vectorOfLongs!);
2092 final int? vectorOfDoublesOffset = _vectorOfDoubles == null ? null
2093 : fbBuilder.writeListFloat64(_vectorOfDoubles!);
2094 final int? parentNamespaceTestOffset = _parentNamespaceTest?.getOrCreateOffset(fbBuilder);
2095 final int? vectorOfReferrablesOffset = _vectorOfReferrables == null ? null
2096 : fbBuilder.writeList(_vectorOfReferrables!.map((b) => b.getOrCreateOffset(fbBuilder)).toList());
2097 final int? vectorOfWeakReferencesOffset = _vectorOfWeakReferences == null ? null
2098 : fbBuilder.writeListUint64(_vectorOfWeakReferences!);
2099 final int? vectorOfStrongReferrablesOffset = _vectorOfStrongReferrables == null ? null
2100 : fbBuilder.writeList(_vectorOfStrongReferrables!.map((b) => b.getOrCreateOffset(fbBuilder)).toList());
2101 final int? vectorOfCoOwningReferencesOffset = _vectorOfCoOwningReferences == null ? null
2102 : fbBuilder.writeListUint64(_vectorOfCoOwningReferences!);
2103 final int? vectorOfNonOwningReferencesOffset = _vectorOfNonOwningReferences == null ? null
2104 : fbBuilder.writeListUint64(_vectorOfNonOwningReferences!);
2105 final int? anyUniqueOffset = _anyUnique?.getOrCreateOffset(fbBuilder);
2106 final int? anyAmbiguousOffset = _anyAmbiguous?.getOrCreateOffset(fbBuilder);
2107 final int? vectorOfEnumsOffset = _vectorOfEnums == null ? null
2108 : fbBuilder.writeListUint8(_vectorOfEnums!.map((f) => f.value).toList());
2109 final int? testrequirednestedflatbufferOffset = _testrequirednestedflatbuffer == null ? null
2110 : fbBuilder.writeListUint8(_testrequirednestedflatbuffer!);
2111 final int? scalarKeySortedTablesOffset = _scalarKeySortedTables == null ? null
2112 : fbBuilder.writeList(_scalarKeySortedTables!.map((b) => b.getOrCreateOffset(fbBuilder)).toList());
James Kuszmaul3b15b0c2022-11-08 14:03:16 -08002113 fbBuilder.startTable(62);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002114 if (_pos != null) {
James Kuszmaul8e62b022022-03-22 09:33:25 -07002115 fbBuilder.addStruct(0, _pos!.finish(fbBuilder));
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002116 }
2117 fbBuilder.addInt16(1, _mana);
2118 fbBuilder.addInt16(2, _hp);
James Kuszmaul8e62b022022-03-22 09:33:25 -07002119 fbBuilder.addOffset(3, nameOffset);
2120 fbBuilder.addOffset(5, inventoryOffset);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002121 fbBuilder.addUint8(6, _color?.value);
2122 fbBuilder.addUint8(7, _testType?.value);
James Kuszmaul8e62b022022-03-22 09:33:25 -07002123 fbBuilder.addOffset(8, testOffset);
2124 fbBuilder.addOffset(9, test4Offset);
2125 fbBuilder.addOffset(10, testarrayofstringOffset);
2126 fbBuilder.addOffset(11, testarrayoftablesOffset);
2127 fbBuilder.addOffset(12, enemyOffset);
2128 fbBuilder.addOffset(13, testnestedflatbufferOffset);
2129 fbBuilder.addOffset(14, testemptyOffset);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002130 fbBuilder.addBool(15, _testbool);
2131 fbBuilder.addInt32(16, _testhashs32Fnv1);
2132 fbBuilder.addUint32(17, _testhashu32Fnv1);
2133 fbBuilder.addInt64(18, _testhashs64Fnv1);
2134 fbBuilder.addUint64(19, _testhashu64Fnv1);
2135 fbBuilder.addInt32(20, _testhashs32Fnv1a);
2136 fbBuilder.addUint32(21, _testhashu32Fnv1a);
2137 fbBuilder.addInt64(22, _testhashs64Fnv1a);
2138 fbBuilder.addUint64(23, _testhashu64Fnv1a);
James Kuszmaul8e62b022022-03-22 09:33:25 -07002139 fbBuilder.addOffset(24, testarrayofboolsOffset);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002140 fbBuilder.addFloat32(25, _testf);
2141 fbBuilder.addFloat32(26, _testf2);
2142 fbBuilder.addFloat32(27, _testf3);
James Kuszmaul8e62b022022-03-22 09:33:25 -07002143 fbBuilder.addOffset(28, testarrayofstring2Offset);
2144 fbBuilder.addOffset(29, testarrayofsortedstructOffset);
2145 fbBuilder.addOffset(30, flexOffset);
2146 fbBuilder.addOffset(31, test5Offset);
2147 fbBuilder.addOffset(32, vectorOfLongsOffset);
2148 fbBuilder.addOffset(33, vectorOfDoublesOffset);
2149 fbBuilder.addOffset(34, parentNamespaceTestOffset);
2150 fbBuilder.addOffset(35, vectorOfReferrablesOffset);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002151 fbBuilder.addUint64(36, _singleWeakReference);
James Kuszmaul8e62b022022-03-22 09:33:25 -07002152 fbBuilder.addOffset(37, vectorOfWeakReferencesOffset);
2153 fbBuilder.addOffset(38, vectorOfStrongReferrablesOffset);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002154 fbBuilder.addUint64(39, _coOwningReference);
James Kuszmaul8e62b022022-03-22 09:33:25 -07002155 fbBuilder.addOffset(40, vectorOfCoOwningReferencesOffset);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002156 fbBuilder.addUint64(41, _nonOwningReference);
James Kuszmaul8e62b022022-03-22 09:33:25 -07002157 fbBuilder.addOffset(42, vectorOfNonOwningReferencesOffset);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002158 fbBuilder.addUint8(43, _anyUniqueType?.value);
James Kuszmaul8e62b022022-03-22 09:33:25 -07002159 fbBuilder.addOffset(44, anyUniqueOffset);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002160 fbBuilder.addUint8(45, _anyAmbiguousType?.value);
James Kuszmaul8e62b022022-03-22 09:33:25 -07002161 fbBuilder.addOffset(46, anyAmbiguousOffset);
2162 fbBuilder.addOffset(47, vectorOfEnumsOffset);
Austin Schuh272c6132020-11-14 16:37:52 -08002163 fbBuilder.addInt8(48, _signedEnum?.value);
James Kuszmaul8e62b022022-03-22 09:33:25 -07002164 fbBuilder.addOffset(49, testrequirednestedflatbufferOffset);
2165 fbBuilder.addOffset(50, scalarKeySortedTablesOffset);
2166 if (_nativeInline != null) {
2167 fbBuilder.addStruct(51, _nativeInline!.finish(fbBuilder));
Austin Schuh272c6132020-11-14 16:37:52 -08002168 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07002169 fbBuilder.addUint64(52, _longEnumNonEnumDefault?.value);
2170 fbBuilder.addUint64(53, _longEnumNormalDefault?.value);
James Kuszmaul3b15b0c2022-11-08 14:03:16 -08002171 fbBuilder.addFloat32(54, _nanDefault);
2172 fbBuilder.addFloat32(55, _infDefault);
2173 fbBuilder.addFloat32(56, _positiveInfDefault);
2174 fbBuilder.addFloat32(57, _infinityDefault);
2175 fbBuilder.addFloat32(58, _positiveInfinityDefault);
2176 fbBuilder.addFloat32(59, _negativeInfDefault);
2177 fbBuilder.addFloat32(60, _negativeInfinityDefault);
2178 fbBuilder.addFloat64(61, _doubleInfDefault);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002179 return fbBuilder.endTable();
2180 }
2181
2182 /// Convenience method to serialize to byte list.
2183 @override
James Kuszmaul8e62b022022-03-22 09:33:25 -07002184 Uint8List toBytes([String? fileIdentifier]) {
2185 final fbBuilder = fb.Builder(deduplicateTables: false);
2186 fbBuilder.finish(finish(fbBuilder), fileIdentifier);
2187 return fbBuilder.buffer;
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002188 }
2189}
2190class TypeAliases {
2191 TypeAliases._(this._bc, this._bcOffset);
2192 factory TypeAliases(List<int> bytes) {
James Kuszmaul8e62b022022-03-22 09:33:25 -07002193 final rootRef = fb.BufferContext.fromBytes(bytes);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002194 return reader.read(rootRef, 0);
2195 }
2196
James Kuszmaul8e62b022022-03-22 09:33:25 -07002197 static const fb.Reader<TypeAliases> reader = _TypeAliasesReader();
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002198
2199 final fb.BufferContext _bc;
2200 final int _bcOffset;
2201
2202 int get i8 => const fb.Int8Reader().vTableGet(_bc, _bcOffset, 4, 0);
2203 int get u8 => const fb.Uint8Reader().vTableGet(_bc, _bcOffset, 6, 0);
2204 int get i16 => const fb.Int16Reader().vTableGet(_bc, _bcOffset, 8, 0);
2205 int get u16 => const fb.Uint16Reader().vTableGet(_bc, _bcOffset, 10, 0);
2206 int get i32 => const fb.Int32Reader().vTableGet(_bc, _bcOffset, 12, 0);
2207 int get u32 => const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 14, 0);
2208 int get i64 => const fb.Int64Reader().vTableGet(_bc, _bcOffset, 16, 0);
2209 int get u64 => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 18, 0);
2210 double get f32 => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 20, 0.0);
2211 double get f64 => const fb.Float64Reader().vTableGet(_bc, _bcOffset, 22, 0.0);
James Kuszmaul8e62b022022-03-22 09:33:25 -07002212 List<int>? get v8 => const fb.Int8ListReader().vTableGetNullable(_bc, _bcOffset, 24);
2213 List<double>? get vf64 => const fb.ListReader<double>(fb.Float64Reader()).vTableGetNullable(_bc, _bcOffset, 26);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002214
2215 @override
2216 String toString() {
Austin Schuh2dd86a92022-09-14 21:19:23 -07002217 return 'TypeAliases{i8: ${i8}, u8: ${u8}, i16: ${i16}, u16: ${u16}, i32: ${i32}, u32: ${u32}, i64: ${i64}, u64: ${u64}, f32: ${f32}, f64: ${f64}, v8: ${v8}, vf64: ${vf64}}';
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002218 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07002219
2220 TypeAliasesT unpack() => TypeAliasesT(
2221 i8: i8,
2222 u8: u8,
2223 i16: i16,
2224 u16: u16,
2225 i32: i32,
2226 u32: u32,
2227 i64: i64,
2228 u64: u64,
2229 f32: f32,
2230 f64: f64,
2231 v8: const fb.Int8ListReader(lazy: false).vTableGetNullable(_bc, _bcOffset, 24),
2232 vf64: const fb.ListReader<double>(fb.Float64Reader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 26));
2233
2234 static int pack(fb.Builder fbBuilder, TypeAliasesT? object) {
2235 if (object == null) return 0;
2236 return object.pack(fbBuilder);
2237 }
2238}
2239
2240class TypeAliasesT implements fb.Packable {
2241 int i8;
2242 int u8;
2243 int i16;
2244 int u16;
2245 int i32;
2246 int u32;
2247 int i64;
2248 int u64;
2249 double f32;
2250 double f64;
2251 List<int>? v8;
2252 List<double>? vf64;
2253
2254 TypeAliasesT({
2255 this.i8 = 0,
2256 this.u8 = 0,
2257 this.i16 = 0,
2258 this.u16 = 0,
2259 this.i32 = 0,
2260 this.u32 = 0,
2261 this.i64 = 0,
2262 this.u64 = 0,
2263 this.f32 = 0.0,
2264 this.f64 = 0.0,
2265 this.v8,
2266 this.vf64});
2267
2268 @override
2269 int pack(fb.Builder fbBuilder) {
2270 final int? v8Offset = v8 == null ? null
2271 : fbBuilder.writeListInt8(v8!);
2272 final int? vf64Offset = vf64 == null ? null
2273 : fbBuilder.writeListFloat64(vf64!);
2274 fbBuilder.startTable(12);
2275 fbBuilder.addInt8(0, i8);
2276 fbBuilder.addUint8(1, u8);
2277 fbBuilder.addInt16(2, i16);
2278 fbBuilder.addUint16(3, u16);
2279 fbBuilder.addInt32(4, i32);
2280 fbBuilder.addUint32(5, u32);
2281 fbBuilder.addInt64(6, i64);
2282 fbBuilder.addUint64(7, u64);
2283 fbBuilder.addFloat32(8, f32);
2284 fbBuilder.addFloat64(9, f64);
2285 fbBuilder.addOffset(10, v8Offset);
2286 fbBuilder.addOffset(11, vf64Offset);
2287 return fbBuilder.endTable();
2288 }
2289
2290 @override
2291 String toString() {
Austin Schuh2dd86a92022-09-14 21:19:23 -07002292 return 'TypeAliasesT{i8: ${i8}, u8: ${u8}, i16: ${i16}, u16: ${u16}, i32: ${i32}, u32: ${u32}, i64: ${i64}, u64: ${u64}, f32: ${f32}, f64: ${f64}, v8: ${v8}, vf64: ${vf64}}';
James Kuszmaul8e62b022022-03-22 09:33:25 -07002293 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002294}
2295
2296class _TypeAliasesReader extends fb.TableReader<TypeAliases> {
2297 const _TypeAliasesReader();
2298
2299 @override
2300 TypeAliases createObject(fb.BufferContext bc, int offset) =>
James Kuszmaul8e62b022022-03-22 09:33:25 -07002301 TypeAliases._(bc, offset);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002302}
2303
2304class TypeAliasesBuilder {
James Kuszmaul8e62b022022-03-22 09:33:25 -07002305 TypeAliasesBuilder(this.fbBuilder);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002306
2307 final fb.Builder fbBuilder;
2308
2309 void begin() {
James Kuszmaul8e62b022022-03-22 09:33:25 -07002310 fbBuilder.startTable(12);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002311 }
2312
James Kuszmaul8e62b022022-03-22 09:33:25 -07002313 int addI8(int? i8) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002314 fbBuilder.addInt8(0, i8);
2315 return fbBuilder.offset;
2316 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07002317 int addU8(int? u8) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002318 fbBuilder.addUint8(1, u8);
2319 return fbBuilder.offset;
2320 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07002321 int addI16(int? i16) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002322 fbBuilder.addInt16(2, i16);
2323 return fbBuilder.offset;
2324 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07002325 int addU16(int? u16) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002326 fbBuilder.addUint16(3, u16);
2327 return fbBuilder.offset;
2328 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07002329 int addI32(int? i32) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002330 fbBuilder.addInt32(4, i32);
2331 return fbBuilder.offset;
2332 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07002333 int addU32(int? u32) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002334 fbBuilder.addUint32(5, u32);
2335 return fbBuilder.offset;
2336 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07002337 int addI64(int? i64) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002338 fbBuilder.addInt64(6, i64);
2339 return fbBuilder.offset;
2340 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07002341 int addU64(int? u64) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002342 fbBuilder.addUint64(7, u64);
2343 return fbBuilder.offset;
2344 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07002345 int addF32(double? f32) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002346 fbBuilder.addFloat32(8, f32);
2347 return fbBuilder.offset;
2348 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07002349 int addF64(double? f64) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002350 fbBuilder.addFloat64(9, f64);
2351 return fbBuilder.offset;
2352 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07002353 int addV8Offset(int? offset) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002354 fbBuilder.addOffset(10, offset);
2355 return fbBuilder.offset;
2356 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07002357 int addVf64Offset(int? offset) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002358 fbBuilder.addOffset(11, offset);
2359 return fbBuilder.offset;
2360 }
2361
2362 int finish() {
2363 return fbBuilder.endTable();
2364 }
2365}
2366
2367class TypeAliasesObjectBuilder extends fb.ObjectBuilder {
James Kuszmaul8e62b022022-03-22 09:33:25 -07002368 final int? _i8;
2369 final int? _u8;
2370 final int? _i16;
2371 final int? _u16;
2372 final int? _i32;
2373 final int? _u32;
2374 final int? _i64;
2375 final int? _u64;
2376 final double? _f32;
2377 final double? _f64;
2378 final List<int>? _v8;
2379 final List<double>? _vf64;
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002380
2381 TypeAliasesObjectBuilder({
James Kuszmaul8e62b022022-03-22 09:33:25 -07002382 int? i8,
2383 int? u8,
2384 int? i16,
2385 int? u16,
2386 int? i32,
2387 int? u32,
2388 int? i64,
2389 int? u64,
2390 double? f32,
2391 double? f64,
2392 List<int>? v8,
2393 List<double>? vf64,
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002394 })
2395 : _i8 = i8,
2396 _u8 = u8,
2397 _i16 = i16,
2398 _u16 = u16,
2399 _i32 = i32,
2400 _u32 = u32,
2401 _i64 = i64,
2402 _u64 = u64,
2403 _f32 = f32,
2404 _f64 = f64,
2405 _v8 = v8,
2406 _vf64 = vf64;
2407
2408 /// Finish building, and store into the [fbBuilder].
2409 @override
James Kuszmaul8e62b022022-03-22 09:33:25 -07002410 int finish(fb.Builder fbBuilder) {
2411 final int? v8Offset = _v8 == null ? null
2412 : fbBuilder.writeListInt8(_v8!);
2413 final int? vf64Offset = _vf64 == null ? null
2414 : fbBuilder.writeListFloat64(_vf64!);
2415 fbBuilder.startTable(12);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002416 fbBuilder.addInt8(0, _i8);
2417 fbBuilder.addUint8(1, _u8);
2418 fbBuilder.addInt16(2, _i16);
2419 fbBuilder.addUint16(3, _u16);
2420 fbBuilder.addInt32(4, _i32);
2421 fbBuilder.addUint32(5, _u32);
2422 fbBuilder.addInt64(6, _i64);
2423 fbBuilder.addUint64(7, _u64);
2424 fbBuilder.addFloat32(8, _f32);
2425 fbBuilder.addFloat64(9, _f64);
James Kuszmaul8e62b022022-03-22 09:33:25 -07002426 fbBuilder.addOffset(10, v8Offset);
2427 fbBuilder.addOffset(11, vf64Offset);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002428 return fbBuilder.endTable();
2429 }
2430
2431 /// Convenience method to serialize to byte list.
2432 @override
James Kuszmaul8e62b022022-03-22 09:33:25 -07002433 Uint8List toBytes([String? fileIdentifier]) {
2434 final fbBuilder = fb.Builder(deduplicateTables: false);
2435 fbBuilder.finish(finish(fbBuilder), fileIdentifier);
2436 return fbBuilder.buffer;
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002437 }
2438}