1// automatically generated by the FlatBuffers compiler, do not modify 2// ignore_for_file: unused_import, unused_field, unused_element, unused_local_variable 3 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) { 18 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 } 25 } 26 return result; 27 } 28 29 static Color? _createOrNull(int? value) => 30 value == null ? null : Color.fromValue(value); 31 32 static bool containsValue(int value) => values.containsKey(value); 33 34 static const Color Red = Color._(1); 35 36 /// \brief color Green 37 /// Green is bit_flag with value (1u << 1) 38 static const Color Green = Color._(2); 39 40 /// \brief color Blue (1u << 3) 41 static const Color Blue = Color._(8); 42 static const Map<int, Color> values = { 43 1: Red, 44 2: Green, 45 8: Blue}; 46 47 static const fb.Reader<Color> reader = _ColorReader(); 48 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) => 63 Color.fromValue(const fb.Uint8Reader().read(bc, offset)); 64} 65 66class Race { 67 final int value; 68 const Race._(this.value); 69 70 factory Race.fromValue(int value) { 71 final result = values[value]; 72 if (result == null) { 73 throw StateError('Invalid value $value for bit flag enum Race'); 74 } 75 return result; 76 } 77 78 static Race? _createOrNull(int? value) => 79 value == null ? null : Race.fromValue(value); 80 81 static const int minValue = -1; 82 static const int maxValue = 2; 83 static bool containsValue(int value) => values.containsKey(value); 84 85 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}; 94 95 static const fb.Reader<Race> reader = _RaceReader(); 96 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) => 111 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 155 int get size => 8; 156 157 @override 158 LongEnum read(fb.BufferContext bc, int offset) => 159 LongEnum.fromValue(const fb.Uint64Reader().read(bc, offset)); 160} 161 162class AnyTypeId { 163 final int value; 164 const AnyTypeId._(this.value); 165 166 factory AnyTypeId.fromValue(int value) { 167 final result = values[value]; 168 if (result == null) { 169 throw StateError('Invalid value $value for bit flag enum AnyTypeId'); 170 } 171 return result; 172 } 173 174 static AnyTypeId? _createOrNull(int? value) => 175 value == null ? null : AnyTypeId.fromValue(value); 176 177 static const int minValue = 0; 178 static const int maxValue = 3; 179 static bool containsValue(int value) => values.containsKey(value); 180 181 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}; 190 191 static const fb.Reader<AnyTypeId> reader = _AnyTypeIdReader(); 192 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) => 207 AnyTypeId.fromValue(const fb.Uint8Reader().read(bc, offset)); 208} 209 210class AnyUniqueAliasesTypeId { 211 final int value; 212 const AnyUniqueAliasesTypeId._(this.value); 213 214 factory AnyUniqueAliasesTypeId.fromValue(int value) { 215 final result = values[value]; 216 if (result == null) { 217 throw StateError('Invalid value $value for bit flag enum AnyUniqueAliasesTypeId'); 218 } 219 return result; 220 } 221 222 static AnyUniqueAliasesTypeId? _createOrNull(int? value) => 223 value == null ? null : AnyUniqueAliasesTypeId.fromValue(value); 224 225 static const int minValue = 0; 226 static const int maxValue = 3; 227 static bool containsValue(int value) => values.containsKey(value); 228 229 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}; 238 239 static const fb.Reader<AnyUniqueAliasesTypeId> reader = _AnyUniqueAliasesTypeIdReader(); 240 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) => 255 AnyUniqueAliasesTypeId.fromValue(const fb.Uint8Reader().read(bc, offset)); 256} 257 258class AnyAmbiguousAliasesTypeId { 259 final int value; 260 const AnyAmbiguousAliasesTypeId._(this.value); 261 262 factory AnyAmbiguousAliasesTypeId.fromValue(int value) { 263 final result = values[value]; 264 if (result == null) { 265 throw StateError('Invalid value $value for bit flag enum AnyAmbiguousAliasesTypeId'); 266 } 267 return result; 268 } 269 270 static AnyAmbiguousAliasesTypeId? _createOrNull(int? value) => 271 value == null ? null : AnyAmbiguousAliasesTypeId.fromValue(value); 272 273 static const int minValue = 0; 274 static const int maxValue = 3; 275 static bool containsValue(int value) => values.containsKey(value); 276 277 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}; 286 287 static const fb.Reader<AnyAmbiguousAliasesTypeId> reader = _AnyAmbiguousAliasesTypeIdReader(); 288 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) => 303 AnyAmbiguousAliasesTypeId.fromValue(const fb.Uint8Reader().read(bc, offset)); 304} 305 306class Test { 307 Test._(this._bc, this._bcOffset); 308 309 static const fb.Reader<Test> reader = _TestReader(); 310 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() { 319 return 'Test{a: ${a}, b: ${b}}'; 320 } 321 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() { 350 return 'TestT{a: ${a}, b: ${b}}'; 351 } 352} 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) => 362 Test._(bc, offset); 363} 364 365class TestBuilder { 366 TestBuilder(this.fbBuilder); 367 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({ 384 required int a, 385 required int b, 386 }) 387 : _a = a, 388 _b = b; 389 390 /// Finish building, and store into the [fbBuilder]. 391 @override 392 int finish(fb.Builder fbBuilder) { 393 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 401 Uint8List toBytes([String? fileIdentifier]) { 402 final fbBuilder = fb.Builder(deduplicateTables: false); 403 fbBuilder.finish(finish(fbBuilder), fileIdentifier); 404 return fbBuilder.buffer; 405 } 406} 407class TestSimpleTableWithEnum { 408 TestSimpleTableWithEnum._(this._bc, this._bcOffset); 409 factory TestSimpleTableWithEnum(List<int> bytes) { 410 final rootRef = fb.BufferContext.fromBytes(bytes); 411 return reader.read(rootRef, 0); 412 } 413 414 static const fb.Reader<TestSimpleTableWithEnum> reader = _TestSimpleTableWithEnumReader(); 415 416 final fb.BufferContext _bc; 417 final int _bcOffset; 418 419 Color get color => Color.fromValue(const fb.Uint8Reader().vTableGet(_bc, _bcOffset, 4, 2)); 420 421 @override 422 String toString() { 423 return 'TestSimpleTableWithEnum{color: ${color}}'; 424 } 425 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() { 450 return 'TestSimpleTableWithEnumT{color: ${color}}'; 451 } 452} 453 454class _TestSimpleTableWithEnumReader extends fb.TableReader<TestSimpleTableWithEnum> { 455 const _TestSimpleTableWithEnumReader(); 456 457 @override 458 TestSimpleTableWithEnum createObject(fb.BufferContext bc, int offset) => 459 TestSimpleTableWithEnum._(bc, offset); 460} 461 462class TestSimpleTableWithEnumBuilder { 463 TestSimpleTableWithEnumBuilder(this.fbBuilder); 464 465 final fb.Builder fbBuilder; 466 467 void begin() { 468 fbBuilder.startTable(1); 469 } 470 471 int addColor(Color? color) { 472 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 { 482 final Color? _color; 483 484 TestSimpleTableWithEnumObjectBuilder({ 485 Color? color, 486 }) 487 : _color = color; 488 489 /// Finish building, and store into the [fbBuilder]. 490 @override 491 int finish(fb.Builder fbBuilder) { 492 fbBuilder.startTable(1); 493 fbBuilder.addUint8(0, _color?.value); 494 return fbBuilder.endTable(); 495 } 496 497 /// Convenience method to serialize to byte list. 498 @override 499 Uint8List toBytes([String? fileIdentifier]) { 500 final fbBuilder = fb.Builder(deduplicateTables: false); 501 fbBuilder.finish(finish(fbBuilder), fileIdentifier); 502 return fbBuilder.buffer; 503 } 504} 505class Vec3 { 506 Vec3._(this._bc, this._bcOffset); 507 508 static const fb.Reader<Vec3> reader = _Vec3Reader(); 509 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); 517 Color get test2 => Color.fromValue(const fb.Uint8Reader().read(_bc, _bcOffset + 24)); 518 Test get test3 => Test.reader.read(_bc, _bcOffset + 26); 519 520 @override 521 String toString() { 522 return 'Vec3{x: ${x}, y: ${y}, z: ${z}, test1: ${test1}, test2: ${test2}, test3: ${test3}}'; 523 } 524 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() { 571 return 'Vec3T{x: ${x}, y: ${y}, z: ${z}, test1: ${test1}, test2: ${test2}, test3: ${test3}}'; 572 } 573} 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) => 583 Vec3._(bc, offset); 584} 585 586class Vec3Builder { 587 Vec3Builder(this.fbBuilder); 588 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); 595 fbBuilder.putUint8(test2.value); 596 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({ 615 required double x, 616 required double y, 617 required double z, 618 required double test1, 619 required Color test2, 620 required TestObjectBuilder test3, 621 }) 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 631 int finish(fb.Builder fbBuilder) { 632 fbBuilder.pad(2); 633 _test3.finish(fbBuilder); 634 fbBuilder.pad(1); 635 fbBuilder.putUint8(_test2.value); 636 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 646 Uint8List toBytes([String? fileIdentifier]) { 647 final fbBuilder = fb.Builder(deduplicateTables: false); 648 fbBuilder.finish(finish(fbBuilder), fileIdentifier); 649 return fbBuilder.buffer; 650 } 651} 652class Ability { 653 Ability._(this._bc, this._bcOffset); 654 655 static const fb.Reader<Ability> reader = _AbilityReader(); 656 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() { 665 return 'Ability{id: ${id}, distance: ${distance}}'; 666 } 667 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() { 695 return 'AbilityT{id: ${id}, distance: ${distance}}'; 696 } 697} 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) => 707 Ability._(bc, offset); 708} 709 710class AbilityBuilder { 711 AbilityBuilder(this.fbBuilder); 712 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({ 728 required int id, 729 required int distance, 730 }) 731 : _id = id, 732 _distance = distance; 733 734 /// Finish building, and store into the [fbBuilder]. 735 @override 736 int finish(fb.Builder fbBuilder) { 737 fbBuilder.putUint32(_distance); 738 fbBuilder.putUint32(_id); 739 return fbBuilder.offset; 740 } 741 742 /// Convenience method to serialize to byte list. 743 @override 744 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() { 764 return 'StructOfStructs{a: ${a}, b: ${b}, c: ${c}}'; 765 } 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() { 798 return 'StructOfStructsT{a: ${a}, b: ${b}, c: ${c}}'; 799 } 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; 856 } 857} 858class 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} 946class Stat { 947 Stat._(this._bc, this._bcOffset); 948 factory Stat(List<int> bytes) { 949 final rootRef = fb.BufferContext.fromBytes(bytes); 950 return reader.read(rootRef, 0); 951 } 952 953 static const fb.Reader<Stat> reader = _StatReader(); 954 955 final fb.BufferContext _bc; 956 final int _bcOffset; 957 958 String? get id => const fb.StringReader().vTableGetNullable(_bc, _bcOffset, 4); 959 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() { 964 return 'Stat{id: ${id}, val: ${val}, count: ${count}}'; 965 } 966 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() { 1001 return 'StatT{id: ${id}, val: ${val}, count: ${count}}'; 1002 } 1003} 1004 1005class _StatReader extends fb.TableReader<Stat> { 1006 const _StatReader(); 1007 1008 @override 1009 Stat createObject(fb.BufferContext bc, int offset) => 1010 Stat._(bc, offset); 1011} 1012 1013class StatBuilder { 1014 StatBuilder(this.fbBuilder); 1015 1016 final fb.Builder fbBuilder; 1017 1018 void begin() { 1019 fbBuilder.startTable(3); 1020 } 1021 1022 int addIdOffset(int? offset) { 1023 fbBuilder.addOffset(0, offset); 1024 return fbBuilder.offset; 1025 } 1026 int addVal(int? val) { 1027 fbBuilder.addInt64(1, val); 1028 return fbBuilder.offset; 1029 } 1030 int addCount(int? count) { 1031 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 { 1041 final String? _id; 1042 final int? _val; 1043 final int? _count; 1044 1045 StatObjectBuilder({ 1046 String? id, 1047 int? val, 1048 int? count, 1049 }) 1050 : _id = id, 1051 _val = val, 1052 _count = count; 1053 1054 /// Finish building, and store into the [fbBuilder]. 1055 @override 1056 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); 1061 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 1068 Uint8List toBytes([String? fileIdentifier]) { 1069 final fbBuilder = fb.Builder(deduplicateTables: false); 1070 fbBuilder.finish(finish(fbBuilder), fileIdentifier); 1071 return fbBuilder.buffer; 1072 } 1073} 1074class Referrable { 1075 Referrable._(this._bc, this._bcOffset); 1076 factory Referrable(List<int> bytes) { 1077 final rootRef = fb.BufferContext.fromBytes(bytes); 1078 return reader.read(rootRef, 0); 1079 } 1080 1081 static const fb.Reader<Referrable> reader = _ReferrableReader(); 1082 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() { 1090 return 'Referrable{id: ${id}}'; 1091 } 1092 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() { 1117 return 'ReferrableT{id: ${id}}'; 1118 } 1119} 1120 1121class _ReferrableReader extends fb.TableReader<Referrable> { 1122 const _ReferrableReader(); 1123 1124 @override 1125 Referrable createObject(fb.BufferContext bc, int offset) => 1126 Referrable._(bc, offset); 1127} 1128 1129class ReferrableBuilder { 1130 ReferrableBuilder(this.fbBuilder); 1131 1132 final fb.Builder fbBuilder; 1133 1134 void begin() { 1135 fbBuilder.startTable(1); 1136 } 1137 1138 int addId(int? id) { 1139 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 { 1149 final int? _id; 1150 1151 ReferrableObjectBuilder({ 1152 int? id, 1153 }) 1154 : _id = id; 1155 1156 /// Finish building, and store into the [fbBuilder]. 1157 @override 1158 int finish(fb.Builder fbBuilder) { 1159 fbBuilder.startTable(1); 1160 fbBuilder.addUint64(0, _id); 1161 return fbBuilder.endTable(); 1162 } 1163 1164 /// Convenience method to serialize to byte list. 1165 @override 1166 Uint8List toBytes([String? fileIdentifier]) { 1167 final fbBuilder = fb.Builder(deduplicateTables: false); 1168 fbBuilder.finish(finish(fbBuilder), fileIdentifier); 1169 return fbBuilder.buffer; 1170 } 1171} 1172/// an example documentation comment: "monster object" 1173class Monster { 1174 Monster._(this._bc, this._bcOffset); 1175 factory Monster(List<int> bytes) { 1176 final rootRef = fb.BufferContext.fromBytes(bytes); 1177 return reader.read(rootRef, 0); 1178 } 1179 1180 static const fb.Reader<Monster> reader = _MonsterReader(); 1181 1182 final fb.BufferContext _bc; 1183 final int _bcOffset; 1184 1185 Vec3? get pos => Vec3.reader.vTableGetNullable(_bc, _bcOffset, 4); 1186 int get mana => const fb.Int16Reader().vTableGet(_bc, _bcOffset, 6, 150); 1187 int get hp => const fb.Int16Reader().vTableGet(_bc, _bcOffset, 8, 100); 1188 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)); 1192 dynamic get test { 1193 switch (testType?.value) { 1194 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); 1197 default: return null; 1198 } 1199 } 1200 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); 1202 /// an example documentation comment: this will end up in the generated code 1203 /// multiline too 1204 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); 1208 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); 1217 List<bool>? get testarrayofbools => const fb.ListReader<bool>(fb.BoolReader()).vTableGetNullable(_bc, _bcOffset, 52); 1218 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); 1221 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); 1229 int get singleWeakReference => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 76, 0); 1230 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); 1232 int get coOwningReference => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 82, 0); 1233 List<int>? get vectorOfCoOwningReferences => const fb.ListReader<int>(fb.Uint64Reader()).vTableGetNullable(_bc, _bcOffset, 84); 1234 int get nonOwningReference => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 86, 0); 1235 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)); 1237 dynamic get anyUnique { 1238 switch (anyUniqueType?.value) { 1239 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); 1242 default: return null; 1243 } 1244 } 1245 AnyAmbiguousAliasesTypeId? get anyAmbiguousType => AnyAmbiguousAliasesTypeId._createOrNull(const fb.Uint8Reader().vTableGetNullable(_bc, _bcOffset, 94)); 1246 dynamic get anyAmbiguous { 1247 switch (anyAmbiguousType?.value) { 1248 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); 1251 default: return null; 1252 } 1253 } 1254 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)); 1261 1262 @override 1263 String toString() { 1264 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}}'; 1265 } 1266 1267 MonsterT unpack() => MonsterT( 1268 pos: pos?.unpack(), 1269 mana: mana, 1270 hp: hp, 1271 name: name, 1272 inventory: const fb.Uint8ListReader(lazy: false).vTableGetNullable(_bc, _bcOffset, 14), 1273 color: color, 1274 testType: testType, 1275 test: test, 1276 test4: test4?.map((e) => e.unpack()).toList(), 1277 testarrayofstring: const fb.ListReader<String>(fb.StringReader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 24), 1278 testarrayoftables: testarrayoftables?.map((e) => e.unpack()).toList(), 1279 enemy: enemy?.unpack(), 1280 testnestedflatbuffer: const fb.Uint8ListReader(lazy: false).vTableGetNullable(_bc, _bcOffset, 30), 1281 testempty: testempty?.unpack(), 1282 testbool: testbool, 1283 testhashs32Fnv1: testhashs32Fnv1, 1284 testhashu32Fnv1: testhashu32Fnv1, 1285 testhashs64Fnv1: testhashs64Fnv1, 1286 testhashu64Fnv1: testhashu64Fnv1, 1287 testhashs32Fnv1a: testhashs32Fnv1a, 1288 testhashu32Fnv1a: testhashu32Fnv1a, 1289 testhashs64Fnv1a: testhashs64Fnv1a, 1290 testhashu64Fnv1a: testhashu64Fnv1a, 1291 testarrayofbools: const fb.ListReader<bool>(fb.BoolReader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 52), 1292 testf: testf, 1293 testf2: testf2, 1294 testf3: testf3, 1295 testarrayofstring2: const fb.ListReader<String>(fb.StringReader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 60), 1296 testarrayofsortedstruct: testarrayofsortedstruct?.map((e) => e.unpack()).toList(), 1297 flex: const fb.Uint8ListReader(lazy: false).vTableGetNullable(_bc, _bcOffset, 64), 1298 test5: test5?.map((e) => e.unpack()).toList(), 1299 vectorOfLongs: const fb.ListReader<int>(fb.Int64Reader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 68), 1300 vectorOfDoubles: const fb.ListReader<double>(fb.Float64Reader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 70), 1301 parentNamespaceTest: parentNamespaceTest?.unpack(), 1302 vectorOfReferrables: vectorOfReferrables?.map((e) => e.unpack()).toList(), 1303 singleWeakReference: singleWeakReference, 1304 vectorOfWeakReferences: const fb.ListReader<int>(fb.Uint64Reader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 78), 1305 vectorOfStrongReferrables: vectorOfStrongReferrables?.map((e) => e.unpack()).toList(), 1306 coOwningReference: coOwningReference, 1307 vectorOfCoOwningReferences: const fb.ListReader<int>(fb.Uint64Reader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 84), 1308 nonOwningReference: nonOwningReference, 1309 vectorOfNonOwningReferences: const fb.ListReader<int>(fb.Uint64Reader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 88), 1310 anyUniqueType: anyUniqueType, 1311 anyUnique: anyUnique, 1312 anyAmbiguousType: anyAmbiguousType, 1313 anyAmbiguous: anyAmbiguous, 1314 vectorOfEnums: const fb.ListReader<Color>(Color.reader, lazy: false).vTableGetNullable(_bc, _bcOffset, 98), 1315 signedEnum: signedEnum, 1316 testrequirednestedflatbuffer: const fb.Uint8ListReader(lazy: false).vTableGetNullable(_bc, _bcOffset, 102), 1317 scalarKeySortedTables: scalarKeySortedTables?.map((e) => e.unpack()).toList(), 1318 nativeInline: nativeInline?.unpack(), 1319 longEnumNonEnumDefault: longEnumNonEnumDefault, 1320 longEnumNormalDefault: longEnumNormalDefault); 1321 1322 static int pack(fb.Builder fbBuilder, MonsterT? object) { 1323 if (object == null) return 0; 1324 return object.pack(fbBuilder); 1325 } 1326} 1327 1328/// an example documentation comment: "monster object" 1329class MonsterT implements fb.Packable { 1330 Vec3T? pos; 1331 int mana; 1332 int hp; 1333 String? name; 1334 List<int>? inventory; 1335 Color color; 1336 AnyTypeId? testType; 1337 dynamic test; 1338 List<TestT>? test4; 1339 List<String>? testarrayofstring; 1340 /// an example documentation comment: this will end up in the generated code 1341 /// multiline too 1342 List<MonsterT>? testarrayoftables; 1343 MonsterT? enemy; 1344 List<int>? testnestedflatbuffer; 1345 StatT? testempty; 1346 bool testbool; 1347 int testhashs32Fnv1; 1348 int testhashu32Fnv1; 1349 int testhashs64Fnv1; 1350 int testhashu64Fnv1; 1351 int testhashs32Fnv1a; 1352 int testhashu32Fnv1a; 1353 int testhashs64Fnv1a; 1354 int testhashu64Fnv1a; 1355 List<bool>? testarrayofbools; 1356 double testf; 1357 double testf2; 1358 double testf3; 1359 List<String>? testarrayofstring2; 1360 List<AbilityT>? testarrayofsortedstruct; 1361 List<int>? flex; 1362 List<TestT>? test5; 1363 List<int>? vectorOfLongs; 1364 List<double>? vectorOfDoubles; 1365 my_game.InParentNamespaceT? parentNamespaceTest; 1366 List<ReferrableT>? vectorOfReferrables; 1367 int singleWeakReference; 1368 List<int>? vectorOfWeakReferences; 1369 List<ReferrableT>? vectorOfStrongReferrables; 1370 int coOwningReference; 1371 List<int>? vectorOfCoOwningReferences; 1372 int nonOwningReference; 1373 List<int>? vectorOfNonOwningReferences; 1374 AnyUniqueAliasesTypeId? anyUniqueType; 1375 dynamic anyUnique; 1376 AnyAmbiguousAliasesTypeId? anyAmbiguousType; 1377 dynamic anyAmbiguous; 1378 List<Color>? vectorOfEnums; 1379 Race signedEnum; 1380 List<int>? testrequirednestedflatbuffer; 1381 List<StatT>? scalarKeySortedTables; 1382 TestT? nativeInline; 1383 LongEnum longEnumNonEnumDefault; 1384 LongEnum longEnumNormalDefault; 1385 1386 MonsterT({ 1387 this.pos, 1388 this.mana = 150, 1389 this.hp = 100, 1390 this.name, 1391 this.inventory, 1392 this.color = Color.Blue, 1393 this.testType, 1394 this.test, 1395 this.test4, 1396 this.testarrayofstring, 1397 this.testarrayoftables, 1398 this.enemy, 1399 this.testnestedflatbuffer, 1400 this.testempty, 1401 this.testbool = false, 1402 this.testhashs32Fnv1 = 0, 1403 this.testhashu32Fnv1 = 0, 1404 this.testhashs64Fnv1 = 0, 1405 this.testhashu64Fnv1 = 0, 1406 this.testhashs32Fnv1a = 0, 1407 this.testhashu32Fnv1a = 0, 1408 this.testhashs64Fnv1a = 0, 1409 this.testhashu64Fnv1a = 0, 1410 this.testarrayofbools, 1411 this.testf = 3.14159, 1412 this.testf2 = 3.0, 1413 this.testf3 = 0.0, 1414 this.testarrayofstring2, 1415 this.testarrayofsortedstruct, 1416 this.flex, 1417 this.test5, 1418 this.vectorOfLongs, 1419 this.vectorOfDoubles, 1420 this.parentNamespaceTest, 1421 this.vectorOfReferrables, 1422 this.singleWeakReference = 0, 1423 this.vectorOfWeakReferences, 1424 this.vectorOfStrongReferrables, 1425 this.coOwningReference = 0, 1426 this.vectorOfCoOwningReferences, 1427 this.nonOwningReference = 0, 1428 this.vectorOfNonOwningReferences, 1429 this.anyUniqueType, 1430 this.anyUnique, 1431 this.anyAmbiguousType, 1432 this.anyAmbiguous, 1433 this.vectorOfEnums, 1434 this.signedEnum = Race.None, 1435 this.testrequirednestedflatbuffer, 1436 this.scalarKeySortedTables, 1437 this.nativeInline, 1438 this.longEnumNonEnumDefault = const LongEnum._(0), 1439 this.longEnumNormalDefault = LongEnum.LongOne}); 1440 1441 @override 1442 int pack(fb.Builder fbBuilder) { 1443 final int? nameOffset = name == null ? null 1444 : fbBuilder.writeString(name!); 1445 final int? inventoryOffset = inventory == null ? null 1446 : fbBuilder.writeListUint8(inventory!); 1447 final int? testOffset = test?.pack(fbBuilder); 1448 int? test4Offset; 1449 if (test4 != null) { 1450 for (var e in test4!) { e.pack(fbBuilder); } 1451 test4Offset = fbBuilder.endStructVector(test4!.length); 1452 } 1453 final int? testarrayofstringOffset = testarrayofstring == null ? null 1454 : fbBuilder.writeList(testarrayofstring!.map(fbBuilder.writeString).toList()); 1455 final int? testarrayoftablesOffset = testarrayoftables == null ? null 1456 : fbBuilder.writeList(testarrayoftables!.map((b) => b.pack(fbBuilder)).toList()); 1457 final int? enemyOffset = enemy?.pack(fbBuilder); 1458 final int? testnestedflatbufferOffset = testnestedflatbuffer == null ? null 1459 : fbBuilder.writeListUint8(testnestedflatbuffer!); 1460 final int? testemptyOffset = testempty?.pack(fbBuilder); 1461 final int? testarrayofboolsOffset = testarrayofbools == null ? null 1462 : fbBuilder.writeListBool(testarrayofbools!); 1463 final int? testarrayofstring2Offset = testarrayofstring2 == null ? null 1464 : fbBuilder.writeList(testarrayofstring2!.map(fbBuilder.writeString).toList()); 1465 int? testarrayofsortedstructOffset; 1466 if (testarrayofsortedstruct != null) { 1467 for (var e in testarrayofsortedstruct!) { e.pack(fbBuilder); } 1468 testarrayofsortedstructOffset = fbBuilder.endStructVector(testarrayofsortedstruct!.length); 1469 } 1470 final int? flexOffset = flex == null ? null 1471 : fbBuilder.writeListUint8(flex!); 1472 int? test5Offset; 1473 if (test5 != null) { 1474 for (var e in test5!) { e.pack(fbBuilder); } 1475 test5Offset = fbBuilder.endStructVector(test5!.length); 1476 } 1477 final int? vectorOfLongsOffset = vectorOfLongs == null ? null 1478 : fbBuilder.writeListInt64(vectorOfLongs!); 1479 final int? vectorOfDoublesOffset = vectorOfDoubles == null ? null 1480 : fbBuilder.writeListFloat64(vectorOfDoubles!); 1481 final int? parentNamespaceTestOffset = parentNamespaceTest?.pack(fbBuilder); 1482 final int? vectorOfReferrablesOffset = vectorOfReferrables == null ? null 1483 : fbBuilder.writeList(vectorOfReferrables!.map((b) => b.pack(fbBuilder)).toList()); 1484 final int? vectorOfWeakReferencesOffset = vectorOfWeakReferences == null ? null 1485 : fbBuilder.writeListUint64(vectorOfWeakReferences!); 1486 final int? vectorOfStrongReferrablesOffset = vectorOfStrongReferrables == null ? null 1487 : fbBuilder.writeList(vectorOfStrongReferrables!.map((b) => b.pack(fbBuilder)).toList()); 1488 final int? vectorOfCoOwningReferencesOffset = vectorOfCoOwningReferences == null ? null 1489 : fbBuilder.writeListUint64(vectorOfCoOwningReferences!); 1490 final int? vectorOfNonOwningReferencesOffset = vectorOfNonOwningReferences == null ? null 1491 : fbBuilder.writeListUint64(vectorOfNonOwningReferences!); 1492 final int? anyUniqueOffset = anyUnique?.pack(fbBuilder); 1493 final int? anyAmbiguousOffset = anyAmbiguous?.pack(fbBuilder); 1494 final int? vectorOfEnumsOffset = vectorOfEnums == null ? null 1495 : fbBuilder.writeListUint8(vectorOfEnums!.map((f) => f.value).toList()); 1496 final int? testrequirednestedflatbufferOffset = testrequirednestedflatbuffer == null ? null 1497 : fbBuilder.writeListUint8(testrequirednestedflatbuffer!); 1498 final int? scalarKeySortedTablesOffset = scalarKeySortedTables == null ? null 1499 : fbBuilder.writeList(scalarKeySortedTables!.map((b) => b.pack(fbBuilder)).toList()); 1500 fbBuilder.startTable(54); 1501 if (pos != null) { 1502 fbBuilder.addStruct(0, pos!.pack(fbBuilder)); 1503 } 1504 fbBuilder.addInt16(1, mana); 1505 fbBuilder.addInt16(2, hp); 1506 fbBuilder.addOffset(3, nameOffset); 1507 fbBuilder.addOffset(5, inventoryOffset); 1508 fbBuilder.addUint8(6, color.value); 1509 fbBuilder.addUint8(7, testType?.value); 1510 fbBuilder.addOffset(8, testOffset); 1511 fbBuilder.addOffset(9, test4Offset); 1512 fbBuilder.addOffset(10, testarrayofstringOffset); 1513 fbBuilder.addOffset(11, testarrayoftablesOffset); 1514 fbBuilder.addOffset(12, enemyOffset); 1515 fbBuilder.addOffset(13, testnestedflatbufferOffset); 1516 fbBuilder.addOffset(14, testemptyOffset); 1517 fbBuilder.addBool(15, testbool); 1518 fbBuilder.addInt32(16, testhashs32Fnv1); 1519 fbBuilder.addUint32(17, testhashu32Fnv1); 1520 fbBuilder.addInt64(18, testhashs64Fnv1); 1521 fbBuilder.addUint64(19, testhashu64Fnv1); 1522 fbBuilder.addInt32(20, testhashs32Fnv1a); 1523 fbBuilder.addUint32(21, testhashu32Fnv1a); 1524 fbBuilder.addInt64(22, testhashs64Fnv1a); 1525 fbBuilder.addUint64(23, testhashu64Fnv1a); 1526 fbBuilder.addOffset(24, testarrayofboolsOffset); 1527 fbBuilder.addFloat32(25, testf); 1528 fbBuilder.addFloat32(26, testf2); 1529 fbBuilder.addFloat32(27, testf3); 1530 fbBuilder.addOffset(28, testarrayofstring2Offset); 1531 fbBuilder.addOffset(29, testarrayofsortedstructOffset); 1532 fbBuilder.addOffset(30, flexOffset); 1533 fbBuilder.addOffset(31, test5Offset); 1534 fbBuilder.addOffset(32, vectorOfLongsOffset); 1535 fbBuilder.addOffset(33, vectorOfDoublesOffset); 1536 fbBuilder.addOffset(34, parentNamespaceTestOffset); 1537 fbBuilder.addOffset(35, vectorOfReferrablesOffset); 1538 fbBuilder.addUint64(36, singleWeakReference); 1539 fbBuilder.addOffset(37, vectorOfWeakReferencesOffset); 1540 fbBuilder.addOffset(38, vectorOfStrongReferrablesOffset); 1541 fbBuilder.addUint64(39, coOwningReference); 1542 fbBuilder.addOffset(40, vectorOfCoOwningReferencesOffset); 1543 fbBuilder.addUint64(41, nonOwningReference); 1544 fbBuilder.addOffset(42, vectorOfNonOwningReferencesOffset); 1545 fbBuilder.addUint8(43, anyUniqueType?.value); 1546 fbBuilder.addOffset(44, anyUniqueOffset); 1547 fbBuilder.addUint8(45, anyAmbiguousType?.value); 1548 fbBuilder.addOffset(46, anyAmbiguousOffset); 1549 fbBuilder.addOffset(47, vectorOfEnumsOffset); 1550 fbBuilder.addInt8(48, signedEnum.value); 1551 fbBuilder.addOffset(49, testrequirednestedflatbufferOffset); 1552 fbBuilder.addOffset(50, scalarKeySortedTablesOffset); 1553 if (nativeInline != null) { 1554 fbBuilder.addStruct(51, nativeInline!.pack(fbBuilder)); 1555 } 1556 fbBuilder.addUint64(52, longEnumNonEnumDefault.value); 1557 fbBuilder.addUint64(53, longEnumNormalDefault.value); 1558 return fbBuilder.endTable(); 1559 } 1560 1561 @override 1562 String toString() { 1563 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}}'; 1564 } 1565} 1566 1567class _MonsterReader extends fb.TableReader<Monster> { 1568 const _MonsterReader(); 1569 1570 @override 1571 Monster createObject(fb.BufferContext bc, int offset) => 1572 Monster._(bc, offset); 1573} 1574 1575class MonsterBuilder { 1576 MonsterBuilder(this.fbBuilder); 1577 1578 final fb.Builder fbBuilder; 1579 1580 void begin() { 1581 fbBuilder.startTable(54); 1582 } 1583 1584 int addPos(int offset) { 1585 fbBuilder.addStruct(0, offset); 1586 return fbBuilder.offset; 1587 } 1588 int addMana(int? mana) { 1589 fbBuilder.addInt16(1, mana); 1590 return fbBuilder.offset; 1591 } 1592 int addHp(int? hp) { 1593 fbBuilder.addInt16(2, hp); 1594 return fbBuilder.offset; 1595 } 1596 int addNameOffset(int? offset) { 1597 fbBuilder.addOffset(3, offset); 1598 return fbBuilder.offset; 1599 } 1600 int addInventoryOffset(int? offset) { 1601 fbBuilder.addOffset(5, offset); 1602 return fbBuilder.offset; 1603 } 1604 int addColor(Color? color) { 1605 fbBuilder.addUint8(6, color?.value); 1606 return fbBuilder.offset; 1607 } 1608 int addTestType(AnyTypeId? testType) { 1609 fbBuilder.addUint8(7, testType?.value); 1610 return fbBuilder.offset; 1611 } 1612 int addTestOffset(int? offset) { 1613 fbBuilder.addOffset(8, offset); 1614 return fbBuilder.offset; 1615 } 1616 int addTest4Offset(int? offset) { 1617 fbBuilder.addOffset(9, offset); 1618 return fbBuilder.offset; 1619 } 1620 int addTestarrayofstringOffset(int? offset) { 1621 fbBuilder.addOffset(10, offset); 1622 return fbBuilder.offset; 1623 } 1624 int addTestarrayoftablesOffset(int? offset) { 1625 fbBuilder.addOffset(11, offset); 1626 return fbBuilder.offset; 1627 } 1628 int addEnemyOffset(int? offset) { 1629 fbBuilder.addOffset(12, offset); 1630 return fbBuilder.offset; 1631 } 1632 int addTestnestedflatbufferOffset(int? offset) { 1633 fbBuilder.addOffset(13, offset); 1634 return fbBuilder.offset; 1635 } 1636 int addTestemptyOffset(int? offset) { 1637 fbBuilder.addOffset(14, offset); 1638 return fbBuilder.offset; 1639 } 1640 int addTestbool(bool? testbool) { 1641 fbBuilder.addBool(15, testbool); 1642 return fbBuilder.offset; 1643 } 1644 int addTesthashs32Fnv1(int? testhashs32Fnv1) { 1645 fbBuilder.addInt32(16, testhashs32Fnv1); 1646 return fbBuilder.offset; 1647 } 1648 int addTesthashu32Fnv1(int? testhashu32Fnv1) { 1649 fbBuilder.addUint32(17, testhashu32Fnv1); 1650 return fbBuilder.offset; 1651 } 1652 int addTesthashs64Fnv1(int? testhashs64Fnv1) { 1653 fbBuilder.addInt64(18, testhashs64Fnv1); 1654 return fbBuilder.offset; 1655 } 1656 int addTesthashu64Fnv1(int? testhashu64Fnv1) { 1657 fbBuilder.addUint64(19, testhashu64Fnv1); 1658 return fbBuilder.offset; 1659 } 1660 int addTesthashs32Fnv1a(int? testhashs32Fnv1a) { 1661 fbBuilder.addInt32(20, testhashs32Fnv1a); 1662 return fbBuilder.offset; 1663 } 1664 int addTesthashu32Fnv1a(int? testhashu32Fnv1a) { 1665 fbBuilder.addUint32(21, testhashu32Fnv1a); 1666 return fbBuilder.offset; 1667 } 1668 int addTesthashs64Fnv1a(int? testhashs64Fnv1a) { 1669 fbBuilder.addInt64(22, testhashs64Fnv1a); 1670 return fbBuilder.offset; 1671 } 1672 int addTesthashu64Fnv1a(int? testhashu64Fnv1a) { 1673 fbBuilder.addUint64(23, testhashu64Fnv1a); 1674 return fbBuilder.offset; 1675 } 1676 int addTestarrayofboolsOffset(int? offset) { 1677 fbBuilder.addOffset(24, offset); 1678 return fbBuilder.offset; 1679 } 1680 int addTestf(double? testf) { 1681 fbBuilder.addFloat32(25, testf); 1682 return fbBuilder.offset; 1683 } 1684 int addTestf2(double? testf2) { 1685 fbBuilder.addFloat32(26, testf2); 1686 return fbBuilder.offset; 1687 } 1688 int addTestf3(double? testf3) { 1689 fbBuilder.addFloat32(27, testf3); 1690 return fbBuilder.offset; 1691 } 1692 int addTestarrayofstring2Offset(int? offset) { 1693 fbBuilder.addOffset(28, offset); 1694 return fbBuilder.offset; 1695 } 1696 int addTestarrayofsortedstructOffset(int? offset) { 1697 fbBuilder.addOffset(29, offset); 1698 return fbBuilder.offset; 1699 } 1700 int addFlexOffset(int? offset) { 1701 fbBuilder.addOffset(30, offset); 1702 return fbBuilder.offset; 1703 } 1704 int addTest5Offset(int? offset) { 1705 fbBuilder.addOffset(31, offset); 1706 return fbBuilder.offset; 1707 } 1708 int addVectorOfLongsOffset(int? offset) { 1709 fbBuilder.addOffset(32, offset); 1710 return fbBuilder.offset; 1711 } 1712 int addVectorOfDoublesOffset(int? offset) { 1713 fbBuilder.addOffset(33, offset); 1714 return fbBuilder.offset; 1715 } 1716 int addParentNamespaceTestOffset(int? offset) { 1717 fbBuilder.addOffset(34, offset); 1718 return fbBuilder.offset; 1719 } 1720 int addVectorOfReferrablesOffset(int? offset) { 1721 fbBuilder.addOffset(35, offset); 1722 return fbBuilder.offset; 1723 } 1724 int addSingleWeakReference(int? singleWeakReference) { 1725 fbBuilder.addUint64(36, singleWeakReference); 1726 return fbBuilder.offset; 1727 } 1728 int addVectorOfWeakReferencesOffset(int? offset) { 1729 fbBuilder.addOffset(37, offset); 1730 return fbBuilder.offset; 1731 } 1732 int addVectorOfStrongReferrablesOffset(int? offset) { 1733 fbBuilder.addOffset(38, offset); 1734 return fbBuilder.offset; 1735 } 1736 int addCoOwningReference(int? coOwningReference) { 1737 fbBuilder.addUint64(39, coOwningReference); 1738 return fbBuilder.offset; 1739 } 1740 int addVectorOfCoOwningReferencesOffset(int? offset) { 1741 fbBuilder.addOffset(40, offset); 1742 return fbBuilder.offset; 1743 } 1744 int addNonOwningReference(int? nonOwningReference) { 1745 fbBuilder.addUint64(41, nonOwningReference); 1746 return fbBuilder.offset; 1747 } 1748 int addVectorOfNonOwningReferencesOffset(int? offset) { 1749 fbBuilder.addOffset(42, offset); 1750 return fbBuilder.offset; 1751 } 1752 int addAnyUniqueType(AnyUniqueAliasesTypeId? anyUniqueType) { 1753 fbBuilder.addUint8(43, anyUniqueType?.value); 1754 return fbBuilder.offset; 1755 } 1756 int addAnyUniqueOffset(int? offset) { 1757 fbBuilder.addOffset(44, offset); 1758 return fbBuilder.offset; 1759 } 1760 int addAnyAmbiguousType(AnyAmbiguousAliasesTypeId? anyAmbiguousType) { 1761 fbBuilder.addUint8(45, anyAmbiguousType?.value); 1762 return fbBuilder.offset; 1763 } 1764 int addAnyAmbiguousOffset(int? offset) { 1765 fbBuilder.addOffset(46, offset); 1766 return fbBuilder.offset; 1767 } 1768 int addVectorOfEnumsOffset(int? offset) { 1769 fbBuilder.addOffset(47, offset); 1770 return fbBuilder.offset; 1771 } 1772 int addSignedEnum(Race? signedEnum) { 1773 fbBuilder.addInt8(48, signedEnum?.value); 1774 return fbBuilder.offset; 1775 } 1776 int addTestrequirednestedflatbufferOffset(int? offset) { 1777 fbBuilder.addOffset(49, offset); 1778 return fbBuilder.offset; 1779 } 1780 int addScalarKeySortedTablesOffset(int? offset) { 1781 fbBuilder.addOffset(50, offset); 1782 return fbBuilder.offset; 1783 } 1784 int addNativeInline(int offset) { 1785 fbBuilder.addStruct(51, offset); 1786 return fbBuilder.offset; 1787 } 1788 int addLongEnumNonEnumDefault(LongEnum? longEnumNonEnumDefault) { 1789 fbBuilder.addUint64(52, longEnumNonEnumDefault?.value); 1790 return fbBuilder.offset; 1791 } 1792 int addLongEnumNormalDefault(LongEnum? longEnumNormalDefault) { 1793 fbBuilder.addUint64(53, longEnumNormalDefault?.value); 1794 return fbBuilder.offset; 1795 } 1796 1797 int finish() { 1798 return fbBuilder.endTable(); 1799 } 1800} 1801 1802class MonsterObjectBuilder extends fb.ObjectBuilder { 1803 final Vec3ObjectBuilder? _pos; 1804 final int? _mana; 1805 final int? _hp; 1806 final String? _name; 1807 final List<int>? _inventory; 1808 final Color? _color; 1809 final AnyTypeId? _testType; 1810 final dynamic _test; 1811 final List<TestObjectBuilder>? _test4; 1812 final List<String>? _testarrayofstring; 1813 final List<MonsterObjectBuilder>? _testarrayoftables; 1814 final MonsterObjectBuilder? _enemy; 1815 final List<int>? _testnestedflatbuffer; 1816 final StatObjectBuilder? _testempty; 1817 final bool? _testbool; 1818 final int? _testhashs32Fnv1; 1819 final int? _testhashu32Fnv1; 1820 final int? _testhashs64Fnv1; 1821 final int? _testhashu64Fnv1; 1822 final int? _testhashs32Fnv1a; 1823 final int? _testhashu32Fnv1a; 1824 final int? _testhashs64Fnv1a; 1825 final int? _testhashu64Fnv1a; 1826 final List<bool>? _testarrayofbools; 1827 final double? _testf; 1828 final double? _testf2; 1829 final double? _testf3; 1830 final List<String>? _testarrayofstring2; 1831 final List<AbilityObjectBuilder>? _testarrayofsortedstruct; 1832 final List<int>? _flex; 1833 final List<TestObjectBuilder>? _test5; 1834 final List<int>? _vectorOfLongs; 1835 final List<double>? _vectorOfDoubles; 1836 final my_game.InParentNamespaceObjectBuilder? _parentNamespaceTest; 1837 final List<ReferrableObjectBuilder>? _vectorOfReferrables; 1838 final int? _singleWeakReference; 1839 final List<int>? _vectorOfWeakReferences; 1840 final List<ReferrableObjectBuilder>? _vectorOfStrongReferrables; 1841 final int? _coOwningReference; 1842 final List<int>? _vectorOfCoOwningReferences; 1843 final int? _nonOwningReference; 1844 final List<int>? _vectorOfNonOwningReferences; 1845 final AnyUniqueAliasesTypeId? _anyUniqueType; 1846 final dynamic _anyUnique; 1847 final AnyAmbiguousAliasesTypeId? _anyAmbiguousType; 1848 final dynamic _anyAmbiguous; 1849 final List<Color>? _vectorOfEnums; 1850 final Race? _signedEnum; 1851 final List<int>? _testrequirednestedflatbuffer; 1852 final List<StatObjectBuilder>? _scalarKeySortedTables; 1853 final TestObjectBuilder? _nativeInline; 1854 final LongEnum? _longEnumNonEnumDefault; 1855 final LongEnum? _longEnumNormalDefault; 1856 1857 MonsterObjectBuilder({ 1858 Vec3ObjectBuilder? pos, 1859 int? mana, 1860 int? hp, 1861 String? name, 1862 List<int>? inventory, 1863 Color? color, 1864 AnyTypeId? testType, 1865 dynamic test, 1866 List<TestObjectBuilder>? test4, 1867 List<String>? testarrayofstring, 1868 List<MonsterObjectBuilder>? testarrayoftables, 1869 MonsterObjectBuilder? enemy, 1870 List<int>? testnestedflatbuffer, 1871 StatObjectBuilder? testempty, 1872 bool? testbool, 1873 int? testhashs32Fnv1, 1874 int? testhashu32Fnv1, 1875 int? testhashs64Fnv1, 1876 int? testhashu64Fnv1, 1877 int? testhashs32Fnv1a, 1878 int? testhashu32Fnv1a, 1879 int? testhashs64Fnv1a, 1880 int? testhashu64Fnv1a, 1881 List<bool>? testarrayofbools, 1882 double? testf, 1883 double? testf2, 1884 double? testf3, 1885 List<String>? testarrayofstring2, 1886 List<AbilityObjectBuilder>? testarrayofsortedstruct, 1887 List<int>? flex, 1888 List<TestObjectBuilder>? test5, 1889 List<int>? vectorOfLongs, 1890 List<double>? vectorOfDoubles, 1891 my_game.InParentNamespaceObjectBuilder? parentNamespaceTest, 1892 List<ReferrableObjectBuilder>? vectorOfReferrables, 1893 int? singleWeakReference, 1894 List<int>? vectorOfWeakReferences, 1895 List<ReferrableObjectBuilder>? vectorOfStrongReferrables, 1896 int? coOwningReference, 1897 List<int>? vectorOfCoOwningReferences, 1898 int? nonOwningReference, 1899 List<int>? vectorOfNonOwningReferences, 1900 AnyUniqueAliasesTypeId? anyUniqueType, 1901 dynamic anyUnique, 1902 AnyAmbiguousAliasesTypeId? anyAmbiguousType, 1903 dynamic anyAmbiguous, 1904 List<Color>? vectorOfEnums, 1905 Race? signedEnum, 1906 List<int>? testrequirednestedflatbuffer, 1907 List<StatObjectBuilder>? scalarKeySortedTables, 1908 TestObjectBuilder? nativeInline, 1909 LongEnum? longEnumNonEnumDefault, 1910 LongEnum? longEnumNormalDefault, 1911 }) 1912 : _pos = pos, 1913 _mana = mana, 1914 _hp = hp, 1915 _name = name, 1916 _inventory = inventory, 1917 _color = color, 1918 _testType = testType, 1919 _test = test, 1920 _test4 = test4, 1921 _testarrayofstring = testarrayofstring, 1922 _testarrayoftables = testarrayoftables, 1923 _enemy = enemy, 1924 _testnestedflatbuffer = testnestedflatbuffer, 1925 _testempty = testempty, 1926 _testbool = testbool, 1927 _testhashs32Fnv1 = testhashs32Fnv1, 1928 _testhashu32Fnv1 = testhashu32Fnv1, 1929 _testhashs64Fnv1 = testhashs64Fnv1, 1930 _testhashu64Fnv1 = testhashu64Fnv1, 1931 _testhashs32Fnv1a = testhashs32Fnv1a, 1932 _testhashu32Fnv1a = testhashu32Fnv1a, 1933 _testhashs64Fnv1a = testhashs64Fnv1a, 1934 _testhashu64Fnv1a = testhashu64Fnv1a, 1935 _testarrayofbools = testarrayofbools, 1936 _testf = testf, 1937 _testf2 = testf2, 1938 _testf3 = testf3, 1939 _testarrayofstring2 = testarrayofstring2, 1940 _testarrayofsortedstruct = testarrayofsortedstruct, 1941 _flex = flex, 1942 _test5 = test5, 1943 _vectorOfLongs = vectorOfLongs, 1944 _vectorOfDoubles = vectorOfDoubles, 1945 _parentNamespaceTest = parentNamespaceTest, 1946 _vectorOfReferrables = vectorOfReferrables, 1947 _singleWeakReference = singleWeakReference, 1948 _vectorOfWeakReferences = vectorOfWeakReferences, 1949 _vectorOfStrongReferrables = vectorOfStrongReferrables, 1950 _coOwningReference = coOwningReference, 1951 _vectorOfCoOwningReferences = vectorOfCoOwningReferences, 1952 _nonOwningReference = nonOwningReference, 1953 _vectorOfNonOwningReferences = vectorOfNonOwningReferences, 1954 _anyUniqueType = anyUniqueType, 1955 _anyUnique = anyUnique, 1956 _anyAmbiguousType = anyAmbiguousType, 1957 _anyAmbiguous = anyAmbiguous, 1958 _vectorOfEnums = vectorOfEnums, 1959 _signedEnum = signedEnum, 1960 _testrequirednestedflatbuffer = testrequirednestedflatbuffer, 1961 _scalarKeySortedTables = scalarKeySortedTables, 1962 _nativeInline = nativeInline, 1963 _longEnumNonEnumDefault = longEnumNonEnumDefault, 1964 _longEnumNormalDefault = longEnumNormalDefault; 1965 1966 /// Finish building, and store into the [fbBuilder]. 1967 @override 1968 int finish(fb.Builder fbBuilder) { 1969 final int? nameOffset = _name == null ? null 1970 : fbBuilder.writeString(_name!); 1971 final int? inventoryOffset = _inventory == null ? null 1972 : fbBuilder.writeListUint8(_inventory!); 1973 final int? testOffset = _test?.getOrCreateOffset(fbBuilder); 1974 final int? test4Offset = _test4 == null ? null 1975 : fbBuilder.writeListOfStructs(_test4!); 1976 final int? testarrayofstringOffset = _testarrayofstring == null ? null 1977 : fbBuilder.writeList(_testarrayofstring!.map(fbBuilder.writeString).toList()); 1978 final int? testarrayoftablesOffset = _testarrayoftables == null ? null 1979 : fbBuilder.writeList(_testarrayoftables!.map((b) => b.getOrCreateOffset(fbBuilder)).toList()); 1980 final int? enemyOffset = _enemy?.getOrCreateOffset(fbBuilder); 1981 final int? testnestedflatbufferOffset = _testnestedflatbuffer == null ? null 1982 : fbBuilder.writeListUint8(_testnestedflatbuffer!); 1983 final int? testemptyOffset = _testempty?.getOrCreateOffset(fbBuilder); 1984 final int? testarrayofboolsOffset = _testarrayofbools == null ? null 1985 : fbBuilder.writeListBool(_testarrayofbools!); 1986 final int? testarrayofstring2Offset = _testarrayofstring2 == null ? null 1987 : fbBuilder.writeList(_testarrayofstring2!.map(fbBuilder.writeString).toList()); 1988 final int? testarrayofsortedstructOffset = _testarrayofsortedstruct == null ? null 1989 : fbBuilder.writeListOfStructs(_testarrayofsortedstruct!); 1990 final int? flexOffset = _flex == null ? null 1991 : fbBuilder.writeListUint8(_flex!); 1992 final int? test5Offset = _test5 == null ? null 1993 : fbBuilder.writeListOfStructs(_test5!); 1994 final int? vectorOfLongsOffset = _vectorOfLongs == null ? null 1995 : fbBuilder.writeListInt64(_vectorOfLongs!); 1996 final int? vectorOfDoublesOffset = _vectorOfDoubles == null ? null 1997 : fbBuilder.writeListFloat64(_vectorOfDoubles!); 1998 final int? parentNamespaceTestOffset = _parentNamespaceTest?.getOrCreateOffset(fbBuilder); 1999 final int? vectorOfReferrablesOffset = _vectorOfReferrables == null ? null 2000 : fbBuilder.writeList(_vectorOfReferrables!.map((b) => b.getOrCreateOffset(fbBuilder)).toList()); 2001 final int? vectorOfWeakReferencesOffset = _vectorOfWeakReferences == null ? null 2002 : fbBuilder.writeListUint64(_vectorOfWeakReferences!); 2003 final int? vectorOfStrongReferrablesOffset = _vectorOfStrongReferrables == null ? null 2004 : fbBuilder.writeList(_vectorOfStrongReferrables!.map((b) => b.getOrCreateOffset(fbBuilder)).toList()); 2005 final int? vectorOfCoOwningReferencesOffset = _vectorOfCoOwningReferences == null ? null 2006 : fbBuilder.writeListUint64(_vectorOfCoOwningReferences!); 2007 final int? vectorOfNonOwningReferencesOffset = _vectorOfNonOwningReferences == null ? null 2008 : fbBuilder.writeListUint64(_vectorOfNonOwningReferences!); 2009 final int? anyUniqueOffset = _anyUnique?.getOrCreateOffset(fbBuilder); 2010 final int? anyAmbiguousOffset = _anyAmbiguous?.getOrCreateOffset(fbBuilder); 2011 final int? vectorOfEnumsOffset = _vectorOfEnums == null ? null 2012 : fbBuilder.writeListUint8(_vectorOfEnums!.map((f) => f.value).toList()); 2013 final int? testrequirednestedflatbufferOffset = _testrequirednestedflatbuffer == null ? null 2014 : fbBuilder.writeListUint8(_testrequirednestedflatbuffer!); 2015 final int? scalarKeySortedTablesOffset = _scalarKeySortedTables == null ? null 2016 : fbBuilder.writeList(_scalarKeySortedTables!.map((b) => b.getOrCreateOffset(fbBuilder)).toList()); 2017 fbBuilder.startTable(54); 2018 if (_pos != null) { 2019 fbBuilder.addStruct(0, _pos!.finish(fbBuilder)); 2020 } 2021 fbBuilder.addInt16(1, _mana); 2022 fbBuilder.addInt16(2, _hp); 2023 fbBuilder.addOffset(3, nameOffset); 2024 fbBuilder.addOffset(5, inventoryOffset); 2025 fbBuilder.addUint8(6, _color?.value); 2026 fbBuilder.addUint8(7, _testType?.value); 2027 fbBuilder.addOffset(8, testOffset); 2028 fbBuilder.addOffset(9, test4Offset); 2029 fbBuilder.addOffset(10, testarrayofstringOffset); 2030 fbBuilder.addOffset(11, testarrayoftablesOffset); 2031 fbBuilder.addOffset(12, enemyOffset); 2032 fbBuilder.addOffset(13, testnestedflatbufferOffset); 2033 fbBuilder.addOffset(14, testemptyOffset); 2034 fbBuilder.addBool(15, _testbool); 2035 fbBuilder.addInt32(16, _testhashs32Fnv1); 2036 fbBuilder.addUint32(17, _testhashu32Fnv1); 2037 fbBuilder.addInt64(18, _testhashs64Fnv1); 2038 fbBuilder.addUint64(19, _testhashu64Fnv1); 2039 fbBuilder.addInt32(20, _testhashs32Fnv1a); 2040 fbBuilder.addUint32(21, _testhashu32Fnv1a); 2041 fbBuilder.addInt64(22, _testhashs64Fnv1a); 2042 fbBuilder.addUint64(23, _testhashu64Fnv1a); 2043 fbBuilder.addOffset(24, testarrayofboolsOffset); 2044 fbBuilder.addFloat32(25, _testf); 2045 fbBuilder.addFloat32(26, _testf2); 2046 fbBuilder.addFloat32(27, _testf3); 2047 fbBuilder.addOffset(28, testarrayofstring2Offset); 2048 fbBuilder.addOffset(29, testarrayofsortedstructOffset); 2049 fbBuilder.addOffset(30, flexOffset); 2050 fbBuilder.addOffset(31, test5Offset); 2051 fbBuilder.addOffset(32, vectorOfLongsOffset); 2052 fbBuilder.addOffset(33, vectorOfDoublesOffset); 2053 fbBuilder.addOffset(34, parentNamespaceTestOffset); 2054 fbBuilder.addOffset(35, vectorOfReferrablesOffset); 2055 fbBuilder.addUint64(36, _singleWeakReference); 2056 fbBuilder.addOffset(37, vectorOfWeakReferencesOffset); 2057 fbBuilder.addOffset(38, vectorOfStrongReferrablesOffset); 2058 fbBuilder.addUint64(39, _coOwningReference); 2059 fbBuilder.addOffset(40, vectorOfCoOwningReferencesOffset); 2060 fbBuilder.addUint64(41, _nonOwningReference); 2061 fbBuilder.addOffset(42, vectorOfNonOwningReferencesOffset); 2062 fbBuilder.addUint8(43, _anyUniqueType?.value); 2063 fbBuilder.addOffset(44, anyUniqueOffset); 2064 fbBuilder.addUint8(45, _anyAmbiguousType?.value); 2065 fbBuilder.addOffset(46, anyAmbiguousOffset); 2066 fbBuilder.addOffset(47, vectorOfEnumsOffset); 2067 fbBuilder.addInt8(48, _signedEnum?.value); 2068 fbBuilder.addOffset(49, testrequirednestedflatbufferOffset); 2069 fbBuilder.addOffset(50, scalarKeySortedTablesOffset); 2070 if (_nativeInline != null) { 2071 fbBuilder.addStruct(51, _nativeInline!.finish(fbBuilder)); 2072 } 2073 fbBuilder.addUint64(52, _longEnumNonEnumDefault?.value); 2074 fbBuilder.addUint64(53, _longEnumNormalDefault?.value); 2075 return fbBuilder.endTable(); 2076 } 2077 2078 /// Convenience method to serialize to byte list. 2079 @override 2080 Uint8List toBytes([String? fileIdentifier]) { 2081 final fbBuilder = fb.Builder(deduplicateTables: false); 2082 fbBuilder.finish(finish(fbBuilder), fileIdentifier); 2083 return fbBuilder.buffer; 2084 } 2085} 2086class TypeAliases { 2087 TypeAliases._(this._bc, this._bcOffset); 2088 factory TypeAliases(List<int> bytes) { 2089 final rootRef = fb.BufferContext.fromBytes(bytes); 2090 return reader.read(rootRef, 0); 2091 } 2092 2093 static const fb.Reader<TypeAliases> reader = _TypeAliasesReader(); 2094 2095 final fb.BufferContext _bc; 2096 final int _bcOffset; 2097 2098 int get i8 => const fb.Int8Reader().vTableGet(_bc, _bcOffset, 4, 0); 2099 int get u8 => const fb.Uint8Reader().vTableGet(_bc, _bcOffset, 6, 0); 2100 int get i16 => const fb.Int16Reader().vTableGet(_bc, _bcOffset, 8, 0); 2101 int get u16 => const fb.Uint16Reader().vTableGet(_bc, _bcOffset, 10, 0); 2102 int get i32 => const fb.Int32Reader().vTableGet(_bc, _bcOffset, 12, 0); 2103 int get u32 => const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 14, 0); 2104 int get i64 => const fb.Int64Reader().vTableGet(_bc, _bcOffset, 16, 0); 2105 int get u64 => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 18, 0); 2106 double get f32 => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 20, 0.0); 2107 double get f64 => const fb.Float64Reader().vTableGet(_bc, _bcOffset, 22, 0.0); 2108 List<int>? get v8 => const fb.Int8ListReader().vTableGetNullable(_bc, _bcOffset, 24); 2109 List<double>? get vf64 => const fb.ListReader<double>(fb.Float64Reader()).vTableGetNullable(_bc, _bcOffset, 26); 2110 2111 @override 2112 String toString() { 2113 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}}'; 2114 } 2115 2116 TypeAliasesT unpack() => TypeAliasesT( 2117 i8: i8, 2118 u8: u8, 2119 i16: i16, 2120 u16: u16, 2121 i32: i32, 2122 u32: u32, 2123 i64: i64, 2124 u64: u64, 2125 f32: f32, 2126 f64: f64, 2127 v8: const fb.Int8ListReader(lazy: false).vTableGetNullable(_bc, _bcOffset, 24), 2128 vf64: const fb.ListReader<double>(fb.Float64Reader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 26)); 2129 2130 static int pack(fb.Builder fbBuilder, TypeAliasesT? object) { 2131 if (object == null) return 0; 2132 return object.pack(fbBuilder); 2133 } 2134} 2135 2136class TypeAliasesT implements fb.Packable { 2137 int i8; 2138 int u8; 2139 int i16; 2140 int u16; 2141 int i32; 2142 int u32; 2143 int i64; 2144 int u64; 2145 double f32; 2146 double f64; 2147 List<int>? v8; 2148 List<double>? vf64; 2149 2150 TypeAliasesT({ 2151 this.i8 = 0, 2152 this.u8 = 0, 2153 this.i16 = 0, 2154 this.u16 = 0, 2155 this.i32 = 0, 2156 this.u32 = 0, 2157 this.i64 = 0, 2158 this.u64 = 0, 2159 this.f32 = 0.0, 2160 this.f64 = 0.0, 2161 this.v8, 2162 this.vf64}); 2163 2164 @override 2165 int pack(fb.Builder fbBuilder) { 2166 final int? v8Offset = v8 == null ? null 2167 : fbBuilder.writeListInt8(v8!); 2168 final int? vf64Offset = vf64 == null ? null 2169 : fbBuilder.writeListFloat64(vf64!); 2170 fbBuilder.startTable(12); 2171 fbBuilder.addInt8(0, i8); 2172 fbBuilder.addUint8(1, u8); 2173 fbBuilder.addInt16(2, i16); 2174 fbBuilder.addUint16(3, u16); 2175 fbBuilder.addInt32(4, i32); 2176 fbBuilder.addUint32(5, u32); 2177 fbBuilder.addInt64(6, i64); 2178 fbBuilder.addUint64(7, u64); 2179 fbBuilder.addFloat32(8, f32); 2180 fbBuilder.addFloat64(9, f64); 2181 fbBuilder.addOffset(10, v8Offset); 2182 fbBuilder.addOffset(11, vf64Offset); 2183 return fbBuilder.endTable(); 2184 } 2185 2186 @override 2187 String toString() { 2188 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}}'; 2189 } 2190} 2191 2192class _TypeAliasesReader extends fb.TableReader<TypeAliases> { 2193 const _TypeAliasesReader(); 2194 2195 @override 2196 TypeAliases createObject(fb.BufferContext bc, int offset) => 2197 TypeAliases._(bc, offset); 2198} 2199 2200class TypeAliasesBuilder { 2201 TypeAliasesBuilder(this.fbBuilder); 2202 2203 final fb.Builder fbBuilder; 2204 2205 void begin() { 2206 fbBuilder.startTable(12); 2207 } 2208 2209 int addI8(int? i8) { 2210 fbBuilder.addInt8(0, i8); 2211 return fbBuilder.offset; 2212 } 2213 int addU8(int? u8) { 2214 fbBuilder.addUint8(1, u8); 2215 return fbBuilder.offset; 2216 } 2217 int addI16(int? i16) { 2218 fbBuilder.addInt16(2, i16); 2219 return fbBuilder.offset; 2220 } 2221 int addU16(int? u16) { 2222 fbBuilder.addUint16(3, u16); 2223 return fbBuilder.offset; 2224 } 2225 int addI32(int? i32) { 2226 fbBuilder.addInt32(4, i32); 2227 return fbBuilder.offset; 2228 } 2229 int addU32(int? u32) { 2230 fbBuilder.addUint32(5, u32); 2231 return fbBuilder.offset; 2232 } 2233 int addI64(int? i64) { 2234 fbBuilder.addInt64(6, i64); 2235 return fbBuilder.offset; 2236 } 2237 int addU64(int? u64) { 2238 fbBuilder.addUint64(7, u64); 2239 return fbBuilder.offset; 2240 } 2241 int addF32(double? f32) { 2242 fbBuilder.addFloat32(8, f32); 2243 return fbBuilder.offset; 2244 } 2245 int addF64(double? f64) { 2246 fbBuilder.addFloat64(9, f64); 2247 return fbBuilder.offset; 2248 } 2249 int addV8Offset(int? offset) { 2250 fbBuilder.addOffset(10, offset); 2251 return fbBuilder.offset; 2252 } 2253 int addVf64Offset(int? offset) { 2254 fbBuilder.addOffset(11, offset); 2255 return fbBuilder.offset; 2256 } 2257 2258 int finish() { 2259 return fbBuilder.endTable(); 2260 } 2261} 2262 2263class TypeAliasesObjectBuilder extends fb.ObjectBuilder { 2264 final int? _i8; 2265 final int? _u8; 2266 final int? _i16; 2267 final int? _u16; 2268 final int? _i32; 2269 final int? _u32; 2270 final int? _i64; 2271 final int? _u64; 2272 final double? _f32; 2273 final double? _f64; 2274 final List<int>? _v8; 2275 final List<double>? _vf64; 2276 2277 TypeAliasesObjectBuilder({ 2278 int? i8, 2279 int? u8, 2280 int? i16, 2281 int? u16, 2282 int? i32, 2283 int? u32, 2284 int? i64, 2285 int? u64, 2286 double? f32, 2287 double? f64, 2288 List<int>? v8, 2289 List<double>? vf64, 2290 }) 2291 : _i8 = i8, 2292 _u8 = u8, 2293 _i16 = i16, 2294 _u16 = u16, 2295 _i32 = i32, 2296 _u32 = u32, 2297 _i64 = i64, 2298 _u64 = u64, 2299 _f32 = f32, 2300 _f64 = f64, 2301 _v8 = v8, 2302 _vf64 = vf64; 2303 2304 /// Finish building, and store into the [fbBuilder]. 2305 @override 2306 int finish(fb.Builder fbBuilder) { 2307 final int? v8Offset = _v8 == null ? null 2308 : fbBuilder.writeListInt8(_v8!); 2309 final int? vf64Offset = _vf64 == null ? null 2310 : fbBuilder.writeListFloat64(_vf64!); 2311 fbBuilder.startTable(12); 2312 fbBuilder.addInt8(0, _i8); 2313 fbBuilder.addUint8(1, _u8); 2314 fbBuilder.addInt16(2, _i16); 2315 fbBuilder.addUint16(3, _u16); 2316 fbBuilder.addInt32(4, _i32); 2317 fbBuilder.addUint32(5, _u32); 2318 fbBuilder.addInt64(6, _i64); 2319 fbBuilder.addUint64(7, _u64); 2320 fbBuilder.addFloat32(8, _f32); 2321 fbBuilder.addFloat64(9, _f64); 2322 fbBuilder.addOffset(10, v8Offset); 2323 fbBuilder.addOffset(11, vf64Offset); 2324 return fbBuilder.endTable(); 2325 } 2326 2327 /// Convenience method to serialize to byte list. 2328 @override 2329 Uint8List toBytes([String? fileIdentifier]) { 2330 final fbBuilder = fb.Builder(deduplicateTables: false); 2331 fbBuilder.finish(finish(fbBuilder), fileIdentifier); 2332 return fbBuilder.buffer; 2333 } 2334} 2335