1// automatically generated by the FlatBuffers compiler, do not modify 2// ignore_for_file: unused_import, unused_field, 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 12class Color { 13 final int value; 14 const Color._(this.value); 15 16 factory Color.fromValue(int value) { 17 if (value == null) value = 0; 18 if (!values.containsKey(value)) { 19 throw new StateError('Invalid value $value for bit flag enum Color'); 20 } 21 return values[value]; 22 } 23 24 static bool containsValue(int value) => values.containsKey(value); 25 26 static const Color Red = const Color._(1); 27 static const Color Green = const Color._(2); 28 static const Color Blue = const Color._(8); 29 static get values => {1: Red,2: Green,8: Blue,}; 30 31 static const fb.Reader<Color> reader = const _ColorReader(); 32 33 @override 34 String toString() { 35 return 'Color{value: $value}'; 36 } 37} 38 39class _ColorReader extends fb.Reader<Color> { 40 const _ColorReader(); 41 42 @override 43 int get size => 1; 44 45 @override 46 Color read(fb.BufferContext bc, int offset) => 47 new Color.fromValue(const fb.Int8Reader().read(bc, offset)); 48} 49 50class AnyTypeId { 51 final int value; 52 const AnyTypeId._(this.value); 53 54 factory AnyTypeId.fromValue(int value) { 55 if (value == null) value = 0; 56 if (!values.containsKey(value)) { 57 throw new StateError('Invalid value $value for bit flag enum AnyTypeId'); 58 } 59 return values[value]; 60 } 61 62 static const int minValue = 0; 63 static const int maxValue = 3; 64 static bool containsValue(int value) => values.containsKey(value); 65 66 static const AnyTypeId NONE = const AnyTypeId._(0); 67 static const AnyTypeId Monster = const AnyTypeId._(1); 68 static const AnyTypeId TestSimpleTableWithEnum = const AnyTypeId._(2); 69 static const AnyTypeId MyGame_Example2_Monster = const AnyTypeId._(3); 70 static get values => {0: NONE,1: Monster,2: TestSimpleTableWithEnum,3: MyGame_Example2_Monster,}; 71 72 static const fb.Reader<AnyTypeId> reader = const _AnyTypeIdReader(); 73 74 @override 75 String toString() { 76 return 'AnyTypeId{value: $value}'; 77 } 78} 79 80class _AnyTypeIdReader extends fb.Reader<AnyTypeId> { 81 const _AnyTypeIdReader(); 82 83 @override 84 int get size => 1; 85 86 @override 87 AnyTypeId read(fb.BufferContext bc, int offset) => 88 new AnyTypeId.fromValue(const fb.Uint8Reader().read(bc, offset)); 89} 90 91class AnyUniqueAliasesTypeId { 92 final int value; 93 const AnyUniqueAliasesTypeId._(this.value); 94 95 factory AnyUniqueAliasesTypeId.fromValue(int value) { 96 if (value == null) value = 0; 97 if (!values.containsKey(value)) { 98 throw new StateError('Invalid value $value for bit flag enum AnyUniqueAliasesTypeId'); 99 } 100 return values[value]; 101 } 102 103 static const int minValue = 0; 104 static const int maxValue = 3; 105 static bool containsValue(int value) => values.containsKey(value); 106 107 static const AnyUniqueAliasesTypeId NONE = const AnyUniqueAliasesTypeId._(0); 108 static const AnyUniqueAliasesTypeId M = const AnyUniqueAliasesTypeId._(1); 109 static const AnyUniqueAliasesTypeId T = const AnyUniqueAliasesTypeId._(2); 110 static const AnyUniqueAliasesTypeId M2 = const AnyUniqueAliasesTypeId._(3); 111 static get values => {0: NONE,1: M,2: T,3: M2,}; 112 113 static const fb.Reader<AnyUniqueAliasesTypeId> reader = const _AnyUniqueAliasesTypeIdReader(); 114 115 @override 116 String toString() { 117 return 'AnyUniqueAliasesTypeId{value: $value}'; 118 } 119} 120 121class _AnyUniqueAliasesTypeIdReader extends fb.Reader<AnyUniqueAliasesTypeId> { 122 const _AnyUniqueAliasesTypeIdReader(); 123 124 @override 125 int get size => 1; 126 127 @override 128 AnyUniqueAliasesTypeId read(fb.BufferContext bc, int offset) => 129 new AnyUniqueAliasesTypeId.fromValue(const fb.Uint8Reader().read(bc, offset)); 130} 131 132class AnyAmbiguousAliasesTypeId { 133 final int value; 134 const AnyAmbiguousAliasesTypeId._(this.value); 135 136 factory AnyAmbiguousAliasesTypeId.fromValue(int value) { 137 if (value == null) value = 0; 138 if (!values.containsKey(value)) { 139 throw new StateError('Invalid value $value for bit flag enum AnyAmbiguousAliasesTypeId'); 140 } 141 return values[value]; 142 } 143 144 static const int minValue = 0; 145 static const int maxValue = 3; 146 static bool containsValue(int value) => values.containsKey(value); 147 148 static const AnyAmbiguousAliasesTypeId NONE = const AnyAmbiguousAliasesTypeId._(0); 149 static const AnyAmbiguousAliasesTypeId M1 = const AnyAmbiguousAliasesTypeId._(1); 150 static const AnyAmbiguousAliasesTypeId M2 = const AnyAmbiguousAliasesTypeId._(2); 151 static const AnyAmbiguousAliasesTypeId M3 = const AnyAmbiguousAliasesTypeId._(3); 152 static get values => {0: NONE,1: M1,2: M2,3: M3,}; 153 154 static const fb.Reader<AnyAmbiguousAliasesTypeId> reader = const _AnyAmbiguousAliasesTypeIdReader(); 155 156 @override 157 String toString() { 158 return 'AnyAmbiguousAliasesTypeId{value: $value}'; 159 } 160} 161 162class _AnyAmbiguousAliasesTypeIdReader extends fb.Reader<AnyAmbiguousAliasesTypeId> { 163 const _AnyAmbiguousAliasesTypeIdReader(); 164 165 @override 166 int get size => 1; 167 168 @override 169 AnyAmbiguousAliasesTypeId read(fb.BufferContext bc, int offset) => 170 new AnyAmbiguousAliasesTypeId.fromValue(const fb.Uint8Reader().read(bc, offset)); 171} 172 173class Test { 174 Test._(this._bc, this._bcOffset); 175 176 static const fb.Reader<Test> reader = const _TestReader(); 177 178 final fb.BufferContext _bc; 179 final int _bcOffset; 180 181 int get a => const fb.Int16Reader().read(_bc, _bcOffset + 0); 182 int get b => const fb.Int8Reader().read(_bc, _bcOffset + 2); 183 184 @override 185 String toString() { 186 return 'Test{a: $a, b: $b}'; 187 } 188} 189 190class _TestReader extends fb.StructReader<Test> { 191 const _TestReader(); 192 193 @override 194 int get size => 4; 195 196 @override 197 Test createObject(fb.BufferContext bc, int offset) => 198 new Test._(bc, offset); 199} 200 201class TestBuilder { 202 TestBuilder(this.fbBuilder) { 203 assert(fbBuilder != null); 204 } 205 206 final fb.Builder fbBuilder; 207 208 int finish(int a, int b) { 209 fbBuilder.pad(1); 210 fbBuilder.putInt8(b); 211 fbBuilder.putInt16(a); 212 return fbBuilder.offset; 213 } 214 215} 216 217class TestObjectBuilder extends fb.ObjectBuilder { 218 final int _a; 219 final int _b; 220 221 TestObjectBuilder({ 222 int a, 223 int b, 224 }) 225 : _a = a, 226 _b = b; 227 228 /// Finish building, and store into the [fbBuilder]. 229 @override 230 int finish( 231 fb.Builder fbBuilder) { 232 assert(fbBuilder != null); 233 234 fbBuilder.pad(1); 235 fbBuilder.putInt8(_b); 236 fbBuilder.putInt16(_a); 237 return fbBuilder.offset; 238 } 239 240 /// Convenience method to serialize to byte list. 241 @override 242 Uint8List toBytes([String fileIdentifier]) { 243 fb.Builder fbBuilder = new fb.Builder(); 244 int offset = finish(fbBuilder); 245 return fbBuilder.finish(offset, fileIdentifier); 246 } 247} 248class TestSimpleTableWithEnum { 249 TestSimpleTableWithEnum._(this._bc, this._bcOffset); 250 factory TestSimpleTableWithEnum(List<int> bytes) { 251 fb.BufferContext rootRef = new fb.BufferContext.fromBytes(bytes); 252 return reader.read(rootRef, 0); 253 } 254 255 static const fb.Reader<TestSimpleTableWithEnum> reader = const _TestSimpleTableWithEnumReader(); 256 257 final fb.BufferContext _bc; 258 final int _bcOffset; 259 260 Color get color => new Color.fromValue(const fb.Int8Reader().vTableGet(_bc, _bcOffset, 4, 2)); 261 262 @override 263 String toString() { 264 return 'TestSimpleTableWithEnum{color: $color}'; 265 } 266} 267 268class _TestSimpleTableWithEnumReader extends fb.TableReader<TestSimpleTableWithEnum> { 269 const _TestSimpleTableWithEnumReader(); 270 271 @override 272 TestSimpleTableWithEnum createObject(fb.BufferContext bc, int offset) => 273 new TestSimpleTableWithEnum._(bc, offset); 274} 275 276class TestSimpleTableWithEnumBuilder { 277 TestSimpleTableWithEnumBuilder(this.fbBuilder) { 278 assert(fbBuilder != null); 279 } 280 281 final fb.Builder fbBuilder; 282 283 void begin() { 284 fbBuilder.startTable(); 285 } 286 287 int addColor(Color color) { 288 fbBuilder.addInt8(0, color?.value); 289 return fbBuilder.offset; 290 } 291 292 int finish() { 293 return fbBuilder.endTable(); 294 } 295} 296 297class TestSimpleTableWithEnumObjectBuilder extends fb.ObjectBuilder { 298 final Color _color; 299 300 TestSimpleTableWithEnumObjectBuilder({ 301 Color color, 302 }) 303 : _color = color; 304 305 /// Finish building, and store into the [fbBuilder]. 306 @override 307 int finish( 308 fb.Builder fbBuilder) { 309 assert(fbBuilder != null); 310 311 fbBuilder.startTable(); 312 fbBuilder.addInt8(0, _color?.value); 313 return fbBuilder.endTable(); 314 } 315 316 /// Convenience method to serialize to byte list. 317 @override 318 Uint8List toBytes([String fileIdentifier]) { 319 fb.Builder fbBuilder = new fb.Builder(); 320 int offset = finish(fbBuilder); 321 return fbBuilder.finish(offset, fileIdentifier); 322 } 323} 324class Vec3 { 325 Vec3._(this._bc, this._bcOffset); 326 327 static const fb.Reader<Vec3> reader = const _Vec3Reader(); 328 329 final fb.BufferContext _bc; 330 final int _bcOffset; 331 332 double get x => const fb.Float32Reader().read(_bc, _bcOffset + 0); 333 double get y => const fb.Float32Reader().read(_bc, _bcOffset + 4); 334 double get z => const fb.Float32Reader().read(_bc, _bcOffset + 8); 335 double get test1 => const fb.Float64Reader().read(_bc, _bcOffset + 16); 336 Color get test2 => new Color.fromValue(const fb.Int8Reader().read(_bc, _bcOffset + 24)); 337 Test get test3 => Test.reader.read(_bc, _bcOffset + 26); 338 339 @override 340 String toString() { 341 return 'Vec3{x: $x, y: $y, z: $z, test1: $test1, test2: $test2, test3: $test3}'; 342 } 343} 344 345class _Vec3Reader extends fb.StructReader<Vec3> { 346 const _Vec3Reader(); 347 348 @override 349 int get size => 32; 350 351 @override 352 Vec3 createObject(fb.BufferContext bc, int offset) => 353 new Vec3._(bc, offset); 354} 355 356class Vec3Builder { 357 Vec3Builder(this.fbBuilder) { 358 assert(fbBuilder != null); 359 } 360 361 final fb.Builder fbBuilder; 362 363 int finish(double x, double y, double z, double test1, Color test2, fb.StructBuilder test3) { 364 fbBuilder.pad(2); 365 test3(); 366 fbBuilder.pad(1); 367 fbBuilder.putInt8(test2?.value); 368 fbBuilder.putFloat64(test1); 369 fbBuilder.pad(4); 370 fbBuilder.putFloat32(z); 371 fbBuilder.putFloat32(y); 372 fbBuilder.putFloat32(x); 373 return fbBuilder.offset; 374 } 375 376} 377 378class Vec3ObjectBuilder extends fb.ObjectBuilder { 379 final double _x; 380 final double _y; 381 final double _z; 382 final double _test1; 383 final Color _test2; 384 final TestObjectBuilder _test3; 385 386 Vec3ObjectBuilder({ 387 double x, 388 double y, 389 double z, 390 double test1, 391 Color test2, 392 TestObjectBuilder test3, 393 }) 394 : _x = x, 395 _y = y, 396 _z = z, 397 _test1 = test1, 398 _test2 = test2, 399 _test3 = test3; 400 401 /// Finish building, and store into the [fbBuilder]. 402 @override 403 int finish( 404 fb.Builder fbBuilder) { 405 assert(fbBuilder != null); 406 407 fbBuilder.pad(2); 408 _test3.finish(fbBuilder); 409 fbBuilder.pad(1); 410 fbBuilder.putInt8(_test2?.value); 411 fbBuilder.putFloat64(_test1); 412 fbBuilder.pad(4); 413 fbBuilder.putFloat32(_z); 414 fbBuilder.putFloat32(_y); 415 fbBuilder.putFloat32(_x); 416 return fbBuilder.offset; 417 } 418 419 /// Convenience method to serialize to byte list. 420 @override 421 Uint8List toBytes([String fileIdentifier]) { 422 fb.Builder fbBuilder = new fb.Builder(); 423 int offset = finish(fbBuilder); 424 return fbBuilder.finish(offset, fileIdentifier); 425 } 426} 427class Ability { 428 Ability._(this._bc, this._bcOffset); 429 430 static const fb.Reader<Ability> reader = const _AbilityReader(); 431 432 final fb.BufferContext _bc; 433 final int _bcOffset; 434 435 int get id => const fb.Uint32Reader().read(_bc, _bcOffset + 0); 436 int get distance => const fb.Uint32Reader().read(_bc, _bcOffset + 4); 437 438 @override 439 String toString() { 440 return 'Ability{id: $id, distance: $distance}'; 441 } 442} 443 444class _AbilityReader extends fb.StructReader<Ability> { 445 const _AbilityReader(); 446 447 @override 448 int get size => 8; 449 450 @override 451 Ability createObject(fb.BufferContext bc, int offset) => 452 new Ability._(bc, offset); 453} 454 455class AbilityBuilder { 456 AbilityBuilder(this.fbBuilder) { 457 assert(fbBuilder != null); 458 } 459 460 final fb.Builder fbBuilder; 461 462 int finish(int id, int distance) { 463 fbBuilder.putUint32(distance); 464 fbBuilder.putUint32(id); 465 return fbBuilder.offset; 466 } 467 468} 469 470class AbilityObjectBuilder extends fb.ObjectBuilder { 471 final int _id; 472 final int _distance; 473 474 AbilityObjectBuilder({ 475 int id, 476 int distance, 477 }) 478 : _id = id, 479 _distance = distance; 480 481 /// Finish building, and store into the [fbBuilder]. 482 @override 483 int finish( 484 fb.Builder fbBuilder) { 485 assert(fbBuilder != null); 486 487 fbBuilder.putUint32(_distance); 488 fbBuilder.putUint32(_id); 489 return fbBuilder.offset; 490 } 491 492 /// Convenience method to serialize to byte list. 493 @override 494 Uint8List toBytes([String fileIdentifier]) { 495 fb.Builder fbBuilder = new fb.Builder(); 496 int offset = finish(fbBuilder); 497 return fbBuilder.finish(offset, fileIdentifier); 498 } 499} 500class Stat { 501 Stat._(this._bc, this._bcOffset); 502 factory Stat(List<int> bytes) { 503 fb.BufferContext rootRef = new fb.BufferContext.fromBytes(bytes); 504 return reader.read(rootRef, 0); 505 } 506 507 static const fb.Reader<Stat> reader = const _StatReader(); 508 509 final fb.BufferContext _bc; 510 final int _bcOffset; 511 512 String get id => const fb.StringReader().vTableGet(_bc, _bcOffset, 4, null); 513 int get val => const fb.Int64Reader().vTableGet(_bc, _bcOffset, 6, 0); 514 int get count => const fb.Uint16Reader().vTableGet(_bc, _bcOffset, 8, 0); 515 516 @override 517 String toString() { 518 return 'Stat{id: $id, val: $val, count: $count}'; 519 } 520} 521 522class _StatReader extends fb.TableReader<Stat> { 523 const _StatReader(); 524 525 @override 526 Stat createObject(fb.BufferContext bc, int offset) => 527 new Stat._(bc, offset); 528} 529 530class StatBuilder { 531 StatBuilder(this.fbBuilder) { 532 assert(fbBuilder != null); 533 } 534 535 final fb.Builder fbBuilder; 536 537 void begin() { 538 fbBuilder.startTable(); 539 } 540 541 int addIdOffset(int offset) { 542 fbBuilder.addOffset(0, offset); 543 return fbBuilder.offset; 544 } 545 int addVal(int val) { 546 fbBuilder.addInt64(1, val); 547 return fbBuilder.offset; 548 } 549 int addCount(int count) { 550 fbBuilder.addUint16(2, count); 551 return fbBuilder.offset; 552 } 553 554 int finish() { 555 return fbBuilder.endTable(); 556 } 557} 558 559class StatObjectBuilder extends fb.ObjectBuilder { 560 final String _id; 561 final int _val; 562 final int _count; 563 564 StatObjectBuilder({ 565 String id, 566 int val, 567 int count, 568 }) 569 : _id = id, 570 _val = val, 571 _count = count; 572 573 /// Finish building, and store into the [fbBuilder]. 574 @override 575 int finish( 576 fb.Builder fbBuilder) { 577 assert(fbBuilder != null); 578 final int idOffset = fbBuilder.writeString(_id); 579 580 fbBuilder.startTable(); 581 if (idOffset != null) { 582 fbBuilder.addOffset(0, idOffset); 583 } 584 fbBuilder.addInt64(1, _val); 585 fbBuilder.addUint16(2, _count); 586 return fbBuilder.endTable(); 587 } 588 589 /// Convenience method to serialize to byte list. 590 @override 591 Uint8List toBytes([String fileIdentifier]) { 592 fb.Builder fbBuilder = new fb.Builder(); 593 int offset = finish(fbBuilder); 594 return fbBuilder.finish(offset, fileIdentifier); 595 } 596} 597class Referrable { 598 Referrable._(this._bc, this._bcOffset); 599 factory Referrable(List<int> bytes) { 600 fb.BufferContext rootRef = new fb.BufferContext.fromBytes(bytes); 601 return reader.read(rootRef, 0); 602 } 603 604 static const fb.Reader<Referrable> reader = const _ReferrableReader(); 605 606 final fb.BufferContext _bc; 607 final int _bcOffset; 608 609 int get id => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 4, 0); 610 611 @override 612 String toString() { 613 return 'Referrable{id: $id}'; 614 } 615} 616 617class _ReferrableReader extends fb.TableReader<Referrable> { 618 const _ReferrableReader(); 619 620 @override 621 Referrable createObject(fb.BufferContext bc, int offset) => 622 new Referrable._(bc, offset); 623} 624 625class ReferrableBuilder { 626 ReferrableBuilder(this.fbBuilder) { 627 assert(fbBuilder != null); 628 } 629 630 final fb.Builder fbBuilder; 631 632 void begin() { 633 fbBuilder.startTable(); 634 } 635 636 int addId(int id) { 637 fbBuilder.addUint64(0, id); 638 return fbBuilder.offset; 639 } 640 641 int finish() { 642 return fbBuilder.endTable(); 643 } 644} 645 646class ReferrableObjectBuilder extends fb.ObjectBuilder { 647 final int _id; 648 649 ReferrableObjectBuilder({ 650 int id, 651 }) 652 : _id = id; 653 654 /// Finish building, and store into the [fbBuilder]. 655 @override 656 int finish( 657 fb.Builder fbBuilder) { 658 assert(fbBuilder != null); 659 660 fbBuilder.startTable(); 661 fbBuilder.addUint64(0, _id); 662 return fbBuilder.endTable(); 663 } 664 665 /// Convenience method to serialize to byte list. 666 @override 667 Uint8List toBytes([String fileIdentifier]) { 668 fb.Builder fbBuilder = new fb.Builder(); 669 int offset = finish(fbBuilder); 670 return fbBuilder.finish(offset, fileIdentifier); 671 } 672} 673/// an example documentation comment: monster object 674class Monster { 675 Monster._(this._bc, this._bcOffset); 676 factory Monster(List<int> bytes) { 677 fb.BufferContext rootRef = new fb.BufferContext.fromBytes(bytes); 678 return reader.read(rootRef, 0); 679 } 680 681 static const fb.Reader<Monster> reader = const _MonsterReader(); 682 683 final fb.BufferContext _bc; 684 final int _bcOffset; 685 686 Vec3 get pos => Vec3.reader.vTableGet(_bc, _bcOffset, 4, null); 687 int get mana => const fb.Int16Reader().vTableGet(_bc, _bcOffset, 6, 150); 688 int get hp => const fb.Int16Reader().vTableGet(_bc, _bcOffset, 8, 100); 689 String get name => const fb.StringReader().vTableGet(_bc, _bcOffset, 10, null); 690 List<int> get inventory => const fb.ListReader<int>(const fb.Uint8Reader()).vTableGet(_bc, _bcOffset, 14, null); 691 Color get color => new Color.fromValue(const fb.Int8Reader().vTableGet(_bc, _bcOffset, 16, 8)); 692 AnyTypeId get testType => new AnyTypeId.fromValue(const fb.Uint8Reader().vTableGet(_bc, _bcOffset, 18, 0)); 693 dynamic get test { 694 switch (testType?.value) { 695 case 1: return Monster.reader.vTableGet(_bc, _bcOffset, 20, null); 696 case 2: return TestSimpleTableWithEnum.reader.vTableGet(_bc, _bcOffset, 20, null); 697 case 3: return my_game_example2.Monster.reader.vTableGet(_bc, _bcOffset, 20, null); 698 default: return null; 699 } 700 } 701 List<Test> get test4 => const fb.ListReader<Test>(Test.reader).vTableGet(_bc, _bcOffset, 22, null); 702 List<String> get testarrayofstring => const fb.ListReader<String>(const fb.StringReader()).vTableGet(_bc, _bcOffset, 24, null); 703/// an example documentation comment: this will end up in the generated code 704/// multiline too 705 List<Monster> get testarrayoftables => const fb.ListReader<Monster>(Monster.reader).vTableGet(_bc, _bcOffset, 26, null); 706 Monster get enemy => Monster.reader.vTableGet(_bc, _bcOffset, 28, null); 707 List<int> get testnestedflatbuffer => const fb.ListReader<int>(const fb.Uint8Reader()).vTableGet(_bc, _bcOffset, 30, null); 708 Stat get testempty => Stat.reader.vTableGet(_bc, _bcOffset, 32, null); 709 bool get testbool => const fb.BoolReader().vTableGet(_bc, _bcOffset, 34, false); 710 int get testhashs32Fnv1 => const fb.Int32Reader().vTableGet(_bc, _bcOffset, 36, 0); 711 int get testhashu32Fnv1 => const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 38, 0); 712 int get testhashs64Fnv1 => const fb.Int64Reader().vTableGet(_bc, _bcOffset, 40, 0); 713 int get testhashu64Fnv1 => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 42, 0); 714 int get testhashs32Fnv1a => const fb.Int32Reader().vTableGet(_bc, _bcOffset, 44, 0); 715 int get testhashu32Fnv1a => const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 46, 0); 716 int get testhashs64Fnv1a => const fb.Int64Reader().vTableGet(_bc, _bcOffset, 48, 0); 717 int get testhashu64Fnv1a => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 50, 0); 718 List<bool> get testarrayofbools => const fb.ListReader<bool>(const fb.BoolReader()).vTableGet(_bc, _bcOffset, 52, null); 719 double get testf => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 54, 3.14159); 720 double get testf2 => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 56, 3.0); 721 double get testf3 => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 58, 0.0); 722 List<String> get testarrayofstring2 => const fb.ListReader<String>(const fb.StringReader()).vTableGet(_bc, _bcOffset, 60, null); 723 List<Ability> get testarrayofsortedstruct => const fb.ListReader<Ability>(Ability.reader).vTableGet(_bc, _bcOffset, 62, null); 724 List<int> get flex => const fb.ListReader<int>(const fb.Uint8Reader()).vTableGet(_bc, _bcOffset, 64, null); 725 List<Test> get test5 => const fb.ListReader<Test>(Test.reader).vTableGet(_bc, _bcOffset, 66, null); 726 List<int> get vectorOfLongs => const fb.ListReader<int>(const fb.Int64Reader()).vTableGet(_bc, _bcOffset, 68, null); 727 List<double> get vectorOfDoubles => const fb.ListReader<double>(const fb.Float64Reader()).vTableGet(_bc, _bcOffset, 70, null); 728 my_game.InParentNamespace get parentNamespaceTest => my_game.InParentNamespace.reader.vTableGet(_bc, _bcOffset, 72, null); 729 List<Referrable> get vectorOfReferrables => const fb.ListReader<Referrable>(Referrable.reader).vTableGet(_bc, _bcOffset, 74, null); 730 int get singleWeakReference => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 76, 0); 731 List<int> get vectorOfWeakReferences => const fb.ListReader<int>(const fb.Uint64Reader()).vTableGet(_bc, _bcOffset, 78, null); 732 List<Referrable> get vectorOfStrongReferrables => const fb.ListReader<Referrable>(Referrable.reader).vTableGet(_bc, _bcOffset, 80, null); 733 int get coOwningReference => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 82, 0); 734 List<int> get vectorOfCoOwningReferences => const fb.ListReader<int>(const fb.Uint64Reader()).vTableGet(_bc, _bcOffset, 84, null); 735 int get nonOwningReference => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 86, 0); 736 List<int> get vectorOfNonOwningReferences => const fb.ListReader<int>(const fb.Uint64Reader()).vTableGet(_bc, _bcOffset, 88, null); 737 AnyUniqueAliasesTypeId get anyUniqueType => new AnyUniqueAliasesTypeId.fromValue(const fb.Uint8Reader().vTableGet(_bc, _bcOffset, 90, 0)); 738 dynamic get anyUnique { 739 switch (anyUniqueType?.value) { 740 case 1: return M.reader.vTableGet(_bc, _bcOffset, 92, null); 741 case 2: return T.reader.vTableGet(_bc, _bcOffset, 92, null); 742 case 3: return M2.reader.vTableGet(_bc, _bcOffset, 92, null); 743 default: return null; 744 } 745 } 746 AnyAmbiguousAliasesTypeId get anyAmbiguousType => new AnyAmbiguousAliasesTypeId.fromValue(const fb.Uint8Reader().vTableGet(_bc, _bcOffset, 94, 0)); 747 dynamic get anyAmbiguous { 748 switch (anyAmbiguousType?.value) { 749 case 1: return M1.reader.vTableGet(_bc, _bcOffset, 96, null); 750 case 2: return M2.reader.vTableGet(_bc, _bcOffset, 96, null); 751 case 3: return M3.reader.vTableGet(_bc, _bcOffset, 96, null); 752 default: return null; 753 } 754 } 755 List<Color> get vectorOfEnums => const fb.ListReader<Color>(Color.reader).vTableGet(_bc, _bcOffset, 98, null); 756 757 @override 758 String toString() { 759 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}'; 760 } 761} 762 763class _MonsterReader extends fb.TableReader<Monster> { 764 const _MonsterReader(); 765 766 @override 767 Monster createObject(fb.BufferContext bc, int offset) => 768 new Monster._(bc, offset); 769} 770 771class MonsterBuilder { 772 MonsterBuilder(this.fbBuilder) { 773 assert(fbBuilder != null); 774 } 775 776 final fb.Builder fbBuilder; 777 778 void begin() { 779 fbBuilder.startTable(); 780 } 781 782 int addPos(int offset) { 783 fbBuilder.addStruct(0, offset); 784 return fbBuilder.offset; 785 } 786 int addMana(int mana) { 787 fbBuilder.addInt16(1, mana); 788 return fbBuilder.offset; 789 } 790 int addHp(int hp) { 791 fbBuilder.addInt16(2, hp); 792 return fbBuilder.offset; 793 } 794 int addNameOffset(int offset) { 795 fbBuilder.addOffset(3, offset); 796 return fbBuilder.offset; 797 } 798 int addInventoryOffset(int offset) { 799 fbBuilder.addOffset(5, offset); 800 return fbBuilder.offset; 801 } 802 int addColor(Color color) { 803 fbBuilder.addInt8(6, color?.value); 804 return fbBuilder.offset; 805 } 806 int addTestType(AnyTypeId testType) { 807 fbBuilder.addUint8(7, testType?.value); 808 return fbBuilder.offset; 809 } 810 int addTestOffset(int offset) { 811 fbBuilder.addOffset(8, offset); 812 return fbBuilder.offset; 813 } 814 int addTest4Offset(int offset) { 815 fbBuilder.addOffset(9, offset); 816 return fbBuilder.offset; 817 } 818 int addTestarrayofstringOffset(int offset) { 819 fbBuilder.addOffset(10, offset); 820 return fbBuilder.offset; 821 } 822 int addTestarrayoftablesOffset(int offset) { 823 fbBuilder.addOffset(11, offset); 824 return fbBuilder.offset; 825 } 826 int addEnemyOffset(int offset) { 827 fbBuilder.addOffset(12, offset); 828 return fbBuilder.offset; 829 } 830 int addTestnestedflatbufferOffset(int offset) { 831 fbBuilder.addOffset(13, offset); 832 return fbBuilder.offset; 833 } 834 int addTestemptyOffset(int offset) { 835 fbBuilder.addOffset(14, offset); 836 return fbBuilder.offset; 837 } 838 int addTestbool(bool testbool) { 839 fbBuilder.addBool(15, testbool); 840 return fbBuilder.offset; 841 } 842 int addTesthashs32Fnv1(int testhashs32Fnv1) { 843 fbBuilder.addInt32(16, testhashs32Fnv1); 844 return fbBuilder.offset; 845 } 846 int addTesthashu32Fnv1(int testhashu32Fnv1) { 847 fbBuilder.addUint32(17, testhashu32Fnv1); 848 return fbBuilder.offset; 849 } 850 int addTesthashs64Fnv1(int testhashs64Fnv1) { 851 fbBuilder.addInt64(18, testhashs64Fnv1); 852 return fbBuilder.offset; 853 } 854 int addTesthashu64Fnv1(int testhashu64Fnv1) { 855 fbBuilder.addUint64(19, testhashu64Fnv1); 856 return fbBuilder.offset; 857 } 858 int addTesthashs32Fnv1a(int testhashs32Fnv1a) { 859 fbBuilder.addInt32(20, testhashs32Fnv1a); 860 return fbBuilder.offset; 861 } 862 int addTesthashu32Fnv1a(int testhashu32Fnv1a) { 863 fbBuilder.addUint32(21, testhashu32Fnv1a); 864 return fbBuilder.offset; 865 } 866 int addTesthashs64Fnv1a(int testhashs64Fnv1a) { 867 fbBuilder.addInt64(22, testhashs64Fnv1a); 868 return fbBuilder.offset; 869 } 870 int addTesthashu64Fnv1a(int testhashu64Fnv1a) { 871 fbBuilder.addUint64(23, testhashu64Fnv1a); 872 return fbBuilder.offset; 873 } 874 int addTestarrayofboolsOffset(int offset) { 875 fbBuilder.addOffset(24, offset); 876 return fbBuilder.offset; 877 } 878 int addTestf(double testf) { 879 fbBuilder.addFloat32(25, testf); 880 return fbBuilder.offset; 881 } 882 int addTestf2(double testf2) { 883 fbBuilder.addFloat32(26, testf2); 884 return fbBuilder.offset; 885 } 886 int addTestf3(double testf3) { 887 fbBuilder.addFloat32(27, testf3); 888 return fbBuilder.offset; 889 } 890 int addTestarrayofstring2Offset(int offset) { 891 fbBuilder.addOffset(28, offset); 892 return fbBuilder.offset; 893 } 894 int addTestarrayofsortedstructOffset(int offset) { 895 fbBuilder.addOffset(29, offset); 896 return fbBuilder.offset; 897 } 898 int addFlexOffset(int offset) { 899 fbBuilder.addOffset(30, offset); 900 return fbBuilder.offset; 901 } 902 int addTest5Offset(int offset) { 903 fbBuilder.addOffset(31, offset); 904 return fbBuilder.offset; 905 } 906 int addVectorOfLongsOffset(int offset) { 907 fbBuilder.addOffset(32, offset); 908 return fbBuilder.offset; 909 } 910 int addVectorOfDoublesOffset(int offset) { 911 fbBuilder.addOffset(33, offset); 912 return fbBuilder.offset; 913 } 914 int addParentNamespaceTestOffset(int offset) { 915 fbBuilder.addOffset(34, offset); 916 return fbBuilder.offset; 917 } 918 int addVectorOfReferrablesOffset(int offset) { 919 fbBuilder.addOffset(35, offset); 920 return fbBuilder.offset; 921 } 922 int addSingleWeakReference(int singleWeakReference) { 923 fbBuilder.addUint64(36, singleWeakReference); 924 return fbBuilder.offset; 925 } 926 int addVectorOfWeakReferencesOffset(int offset) { 927 fbBuilder.addOffset(37, offset); 928 return fbBuilder.offset; 929 } 930 int addVectorOfStrongReferrablesOffset(int offset) { 931 fbBuilder.addOffset(38, offset); 932 return fbBuilder.offset; 933 } 934 int addCoOwningReference(int coOwningReference) { 935 fbBuilder.addUint64(39, coOwningReference); 936 return fbBuilder.offset; 937 } 938 int addVectorOfCoOwningReferencesOffset(int offset) { 939 fbBuilder.addOffset(40, offset); 940 return fbBuilder.offset; 941 } 942 int addNonOwningReference(int nonOwningReference) { 943 fbBuilder.addUint64(41, nonOwningReference); 944 return fbBuilder.offset; 945 } 946 int addVectorOfNonOwningReferencesOffset(int offset) { 947 fbBuilder.addOffset(42, offset); 948 return fbBuilder.offset; 949 } 950 int addAnyUniqueType(AnyUniqueAliasesTypeId anyUniqueType) { 951 fbBuilder.addUint8(43, anyUniqueType?.value); 952 return fbBuilder.offset; 953 } 954 int addAnyUniqueOffset(int offset) { 955 fbBuilder.addOffset(44, offset); 956 return fbBuilder.offset; 957 } 958 int addAnyAmbiguousType(AnyAmbiguousAliasesTypeId anyAmbiguousType) { 959 fbBuilder.addUint8(45, anyAmbiguousType?.value); 960 return fbBuilder.offset; 961 } 962 int addAnyAmbiguousOffset(int offset) { 963 fbBuilder.addOffset(46, offset); 964 return fbBuilder.offset; 965 } 966 int addVectorOfEnumsOffset(int offset) { 967 fbBuilder.addOffset(47, offset); 968 return fbBuilder.offset; 969 } 970 971 int finish() { 972 return fbBuilder.endTable(); 973 } 974} 975 976class MonsterObjectBuilder extends fb.ObjectBuilder { 977 final Vec3ObjectBuilder _pos; 978 final int _mana; 979 final int _hp; 980 final String _name; 981 final List<int> _inventory; 982 final Color _color; 983 final AnyTypeId _testType; 984 final dynamic _test; 985 final List<TestObjectBuilder> _test4; 986 final List<String> _testarrayofstring; 987 final List<MonsterObjectBuilder> _testarrayoftables; 988 final MonsterObjectBuilder _enemy; 989 final List<int> _testnestedflatbuffer; 990 final StatObjectBuilder _testempty; 991 final bool _testbool; 992 final int _testhashs32Fnv1; 993 final int _testhashu32Fnv1; 994 final int _testhashs64Fnv1; 995 final int _testhashu64Fnv1; 996 final int _testhashs32Fnv1a; 997 final int _testhashu32Fnv1a; 998 final int _testhashs64Fnv1a; 999 final int _testhashu64Fnv1a; 1000 final List<bool> _testarrayofbools; 1001 final double _testf; 1002 final double _testf2; 1003 final double _testf3; 1004 final List<String> _testarrayofstring2; 1005 final List<AbilityObjectBuilder> _testarrayofsortedstruct; 1006 final List<int> _flex; 1007 final List<TestObjectBuilder> _test5; 1008 final List<int> _vectorOfLongs; 1009 final List<double> _vectorOfDoubles; 1010 final my_game.InParentNamespaceObjectBuilder _parentNamespaceTest; 1011 final List<ReferrableObjectBuilder> _vectorOfReferrables; 1012 final int _singleWeakReference; 1013 final List<int> _vectorOfWeakReferences; 1014 final List<ReferrableObjectBuilder> _vectorOfStrongReferrables; 1015 final int _coOwningReference; 1016 final List<int> _vectorOfCoOwningReferences; 1017 final int _nonOwningReference; 1018 final List<int> _vectorOfNonOwningReferences; 1019 final AnyUniqueAliasesTypeId _anyUniqueType; 1020 final dynamic _anyUnique; 1021 final AnyAmbiguousAliasesTypeId _anyAmbiguousType; 1022 final dynamic _anyAmbiguous; 1023 final List<Color> _vectorOfEnums; 1024 1025 MonsterObjectBuilder({ 1026 Vec3ObjectBuilder pos, 1027 int mana, 1028 int hp, 1029 String name, 1030 List<int> inventory, 1031 Color color, 1032 AnyTypeId testType, 1033 dynamic test, 1034 List<TestObjectBuilder> test4, 1035 List<String> testarrayofstring, 1036 List<MonsterObjectBuilder> testarrayoftables, 1037 MonsterObjectBuilder enemy, 1038 List<int> testnestedflatbuffer, 1039 StatObjectBuilder testempty, 1040 bool testbool, 1041 int testhashs32Fnv1, 1042 int testhashu32Fnv1, 1043 int testhashs64Fnv1, 1044 int testhashu64Fnv1, 1045 int testhashs32Fnv1a, 1046 int testhashu32Fnv1a, 1047 int testhashs64Fnv1a, 1048 int testhashu64Fnv1a, 1049 List<bool> testarrayofbools, 1050 double testf, 1051 double testf2, 1052 double testf3, 1053 List<String> testarrayofstring2, 1054 List<AbilityObjectBuilder> testarrayofsortedstruct, 1055 List<int> flex, 1056 List<TestObjectBuilder> test5, 1057 List<int> vectorOfLongs, 1058 List<double> vectorOfDoubles, 1059 my_game.InParentNamespaceObjectBuilder parentNamespaceTest, 1060 List<ReferrableObjectBuilder> vectorOfReferrables, 1061 int singleWeakReference, 1062 List<int> vectorOfWeakReferences, 1063 List<ReferrableObjectBuilder> vectorOfStrongReferrables, 1064 int coOwningReference, 1065 List<int> vectorOfCoOwningReferences, 1066 int nonOwningReference, 1067 List<int> vectorOfNonOwningReferences, 1068 AnyUniqueAliasesTypeId anyUniqueType, 1069 dynamic anyUnique, 1070 AnyAmbiguousAliasesTypeId anyAmbiguousType, 1071 dynamic anyAmbiguous, 1072 List<Color> vectorOfEnums, 1073 }) 1074 : _pos = pos, 1075 _mana = mana, 1076 _hp = hp, 1077 _name = name, 1078 _inventory = inventory, 1079 _color = color, 1080 _testType = testType, 1081 _test = test, 1082 _test4 = test4, 1083 _testarrayofstring = testarrayofstring, 1084 _testarrayoftables = testarrayoftables, 1085 _enemy = enemy, 1086 _testnestedflatbuffer = testnestedflatbuffer, 1087 _testempty = testempty, 1088 _testbool = testbool, 1089 _testhashs32Fnv1 = testhashs32Fnv1, 1090 _testhashu32Fnv1 = testhashu32Fnv1, 1091 _testhashs64Fnv1 = testhashs64Fnv1, 1092 _testhashu64Fnv1 = testhashu64Fnv1, 1093 _testhashs32Fnv1a = testhashs32Fnv1a, 1094 _testhashu32Fnv1a = testhashu32Fnv1a, 1095 _testhashs64Fnv1a = testhashs64Fnv1a, 1096 _testhashu64Fnv1a = testhashu64Fnv1a, 1097 _testarrayofbools = testarrayofbools, 1098 _testf = testf, 1099 _testf2 = testf2, 1100 _testf3 = testf3, 1101 _testarrayofstring2 = testarrayofstring2, 1102 _testarrayofsortedstruct = testarrayofsortedstruct, 1103 _flex = flex, 1104 _test5 = test5, 1105 _vectorOfLongs = vectorOfLongs, 1106 _vectorOfDoubles = vectorOfDoubles, 1107 _parentNamespaceTest = parentNamespaceTest, 1108 _vectorOfReferrables = vectorOfReferrables, 1109 _singleWeakReference = singleWeakReference, 1110 _vectorOfWeakReferences = vectorOfWeakReferences, 1111 _vectorOfStrongReferrables = vectorOfStrongReferrables, 1112 _coOwningReference = coOwningReference, 1113 _vectorOfCoOwningReferences = vectorOfCoOwningReferences, 1114 _nonOwningReference = nonOwningReference, 1115 _vectorOfNonOwningReferences = vectorOfNonOwningReferences, 1116 _anyUniqueType = anyUniqueType, 1117 _anyUnique = anyUnique, 1118 _anyAmbiguousType = anyAmbiguousType, 1119 _anyAmbiguous = anyAmbiguous, 1120 _vectorOfEnums = vectorOfEnums; 1121 1122 /// Finish building, and store into the [fbBuilder]. 1123 @override 1124 int finish( 1125 fb.Builder fbBuilder) { 1126 assert(fbBuilder != null); 1127 final int nameOffset = fbBuilder.writeString(_name); 1128 final int inventoryOffset = _inventory?.isNotEmpty == true 1129 ? fbBuilder.writeListUint8(_inventory) 1130 : null; 1131 final int testOffset = _test?.getOrCreateOffset(fbBuilder); 1132 final int test4Offset = _test4?.isNotEmpty == true 1133 ? fbBuilder.writeListOfStructs(_test4) 1134 : null; 1135 final int testarrayofstringOffset = _testarrayofstring?.isNotEmpty == true 1136 ? fbBuilder.writeList(_testarrayofstring.map((b) => fbBuilder.writeString(b)).toList()) 1137 : null; 1138 final int testarrayoftablesOffset = _testarrayoftables?.isNotEmpty == true 1139 ? fbBuilder.writeList(_testarrayoftables.map((b) => b.getOrCreateOffset(fbBuilder)).toList()) 1140 : null; 1141 final int enemyOffset = _enemy?.getOrCreateOffset(fbBuilder); 1142 final int testnestedflatbufferOffset = _testnestedflatbuffer?.isNotEmpty == true 1143 ? fbBuilder.writeListUint8(_testnestedflatbuffer) 1144 : null; 1145 final int testemptyOffset = _testempty?.getOrCreateOffset(fbBuilder); 1146 final int testarrayofboolsOffset = _testarrayofbools?.isNotEmpty == true 1147 ? fbBuilder.writeListBool(_testarrayofbools) 1148 : null; 1149 final int testarrayofstring2Offset = _testarrayofstring2?.isNotEmpty == true 1150 ? fbBuilder.writeList(_testarrayofstring2.map((b) => fbBuilder.writeString(b)).toList()) 1151 : null; 1152 final int testarrayofsortedstructOffset = _testarrayofsortedstruct?.isNotEmpty == true 1153 ? fbBuilder.writeListOfStructs(_testarrayofsortedstruct) 1154 : null; 1155 final int flexOffset = _flex?.isNotEmpty == true 1156 ? fbBuilder.writeListUint8(_flex) 1157 : null; 1158 final int test5Offset = _test5?.isNotEmpty == true 1159 ? fbBuilder.writeListOfStructs(_test5) 1160 : null; 1161 final int vectorOfLongsOffset = _vectorOfLongs?.isNotEmpty == true 1162 ? fbBuilder.writeListInt64(_vectorOfLongs) 1163 : null; 1164 final int vectorOfDoublesOffset = _vectorOfDoubles?.isNotEmpty == true 1165 ? fbBuilder.writeListFloat64(_vectorOfDoubles) 1166 : null; 1167 final int parentNamespaceTestOffset = _parentNamespaceTest?.getOrCreateOffset(fbBuilder); 1168 final int vectorOfReferrablesOffset = _vectorOfReferrables?.isNotEmpty == true 1169 ? fbBuilder.writeList(_vectorOfReferrables.map((b) => b.getOrCreateOffset(fbBuilder)).toList()) 1170 : null; 1171 final int vectorOfWeakReferencesOffset = _vectorOfWeakReferences?.isNotEmpty == true 1172 ? fbBuilder.writeListUint64(_vectorOfWeakReferences) 1173 : null; 1174 final int vectorOfStrongReferrablesOffset = _vectorOfStrongReferrables?.isNotEmpty == true 1175 ? fbBuilder.writeList(_vectorOfStrongReferrables.map((b) => b.getOrCreateOffset(fbBuilder)).toList()) 1176 : null; 1177 final int vectorOfCoOwningReferencesOffset = _vectorOfCoOwningReferences?.isNotEmpty == true 1178 ? fbBuilder.writeListUint64(_vectorOfCoOwningReferences) 1179 : null; 1180 final int vectorOfNonOwningReferencesOffset = _vectorOfNonOwningReferences?.isNotEmpty == true 1181 ? fbBuilder.writeListUint64(_vectorOfNonOwningReferences) 1182 : null; 1183 final int anyUniqueOffset = _anyUnique?.getOrCreateOffset(fbBuilder); 1184 final int anyAmbiguousOffset = _anyAmbiguous?.getOrCreateOffset(fbBuilder); 1185 final int vectorOfEnumsOffset = _vectorOfEnums?.isNotEmpty == true 1186 ? fbBuilder.writeListInt8(_vectorOfEnums.map((f) => f.value)) 1187 : null; 1188 1189 fbBuilder.startTable(); 1190 if (_pos != null) { 1191 fbBuilder.addStruct(0, _pos.finish(fbBuilder)); 1192 } 1193 fbBuilder.addInt16(1, _mana); 1194 fbBuilder.addInt16(2, _hp); 1195 if (nameOffset != null) { 1196 fbBuilder.addOffset(3, nameOffset); 1197 } 1198 if (inventoryOffset != null) { 1199 fbBuilder.addOffset(5, inventoryOffset); 1200 } 1201 fbBuilder.addInt8(6, _color?.value); 1202 fbBuilder.addUint8(7, _testType?.value); 1203 if (testOffset != null) { 1204 fbBuilder.addOffset(8, testOffset); 1205 } 1206 if (test4Offset != null) { 1207 fbBuilder.addOffset(9, test4Offset); 1208 } 1209 if (testarrayofstringOffset != null) { 1210 fbBuilder.addOffset(10, testarrayofstringOffset); 1211 } 1212 if (testarrayoftablesOffset != null) { 1213 fbBuilder.addOffset(11, testarrayoftablesOffset); 1214 } 1215 if (enemyOffset != null) { 1216 fbBuilder.addOffset(12, enemyOffset); 1217 } 1218 if (testnestedflatbufferOffset != null) { 1219 fbBuilder.addOffset(13, testnestedflatbufferOffset); 1220 } 1221 if (testemptyOffset != null) { 1222 fbBuilder.addOffset(14, testemptyOffset); 1223 } 1224 fbBuilder.addBool(15, _testbool); 1225 fbBuilder.addInt32(16, _testhashs32Fnv1); 1226 fbBuilder.addUint32(17, _testhashu32Fnv1); 1227 fbBuilder.addInt64(18, _testhashs64Fnv1); 1228 fbBuilder.addUint64(19, _testhashu64Fnv1); 1229 fbBuilder.addInt32(20, _testhashs32Fnv1a); 1230 fbBuilder.addUint32(21, _testhashu32Fnv1a); 1231 fbBuilder.addInt64(22, _testhashs64Fnv1a); 1232 fbBuilder.addUint64(23, _testhashu64Fnv1a); 1233 if (testarrayofboolsOffset != null) { 1234 fbBuilder.addOffset(24, testarrayofboolsOffset); 1235 } 1236 fbBuilder.addFloat32(25, _testf); 1237 fbBuilder.addFloat32(26, _testf2); 1238 fbBuilder.addFloat32(27, _testf3); 1239 if (testarrayofstring2Offset != null) { 1240 fbBuilder.addOffset(28, testarrayofstring2Offset); 1241 } 1242 if (testarrayofsortedstructOffset != null) { 1243 fbBuilder.addOffset(29, testarrayofsortedstructOffset); 1244 } 1245 if (flexOffset != null) { 1246 fbBuilder.addOffset(30, flexOffset); 1247 } 1248 if (test5Offset != null) { 1249 fbBuilder.addOffset(31, test5Offset); 1250 } 1251 if (vectorOfLongsOffset != null) { 1252 fbBuilder.addOffset(32, vectorOfLongsOffset); 1253 } 1254 if (vectorOfDoublesOffset != null) { 1255 fbBuilder.addOffset(33, vectorOfDoublesOffset); 1256 } 1257 if (parentNamespaceTestOffset != null) { 1258 fbBuilder.addOffset(34, parentNamespaceTestOffset); 1259 } 1260 if (vectorOfReferrablesOffset != null) { 1261 fbBuilder.addOffset(35, vectorOfReferrablesOffset); 1262 } 1263 fbBuilder.addUint64(36, _singleWeakReference); 1264 if (vectorOfWeakReferencesOffset != null) { 1265 fbBuilder.addOffset(37, vectorOfWeakReferencesOffset); 1266 } 1267 if (vectorOfStrongReferrablesOffset != null) { 1268 fbBuilder.addOffset(38, vectorOfStrongReferrablesOffset); 1269 } 1270 fbBuilder.addUint64(39, _coOwningReference); 1271 if (vectorOfCoOwningReferencesOffset != null) { 1272 fbBuilder.addOffset(40, vectorOfCoOwningReferencesOffset); 1273 } 1274 fbBuilder.addUint64(41, _nonOwningReference); 1275 if (vectorOfNonOwningReferencesOffset != null) { 1276 fbBuilder.addOffset(42, vectorOfNonOwningReferencesOffset); 1277 } 1278 fbBuilder.addUint8(43, _anyUniqueType?.value); 1279 if (anyUniqueOffset != null) { 1280 fbBuilder.addOffset(44, anyUniqueOffset); 1281 } 1282 fbBuilder.addUint8(45, _anyAmbiguousType?.value); 1283 if (anyAmbiguousOffset != null) { 1284 fbBuilder.addOffset(46, anyAmbiguousOffset); 1285 } 1286 if (vectorOfEnumsOffset != null) { 1287 fbBuilder.addOffset(47, vectorOfEnumsOffset); 1288 } 1289 return fbBuilder.endTable(); 1290 } 1291 1292 /// Convenience method to serialize to byte list. 1293 @override 1294 Uint8List toBytes([String fileIdentifier]) { 1295 fb.Builder fbBuilder = new fb.Builder(); 1296 int offset = finish(fbBuilder); 1297 return fbBuilder.finish(offset, fileIdentifier); 1298 } 1299} 1300class TypeAliases { 1301 TypeAliases._(this._bc, this._bcOffset); 1302 factory TypeAliases(List<int> bytes) { 1303 fb.BufferContext rootRef = new fb.BufferContext.fromBytes(bytes); 1304 return reader.read(rootRef, 0); 1305 } 1306 1307 static const fb.Reader<TypeAliases> reader = const _TypeAliasesReader(); 1308 1309 final fb.BufferContext _bc; 1310 final int _bcOffset; 1311 1312 int get i8 => const fb.Int8Reader().vTableGet(_bc, _bcOffset, 4, 0); 1313 int get u8 => const fb.Uint8Reader().vTableGet(_bc, _bcOffset, 6, 0); 1314 int get i16 => const fb.Int16Reader().vTableGet(_bc, _bcOffset, 8, 0); 1315 int get u16 => const fb.Uint16Reader().vTableGet(_bc, _bcOffset, 10, 0); 1316 int get i32 => const fb.Int32Reader().vTableGet(_bc, _bcOffset, 12, 0); 1317 int get u32 => const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 14, 0); 1318 int get i64 => const fb.Int64Reader().vTableGet(_bc, _bcOffset, 16, 0); 1319 int get u64 => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 18, 0); 1320 double get f32 => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 20, 0.0); 1321 double get f64 => const fb.Float64Reader().vTableGet(_bc, _bcOffset, 22, 0.0); 1322 List<int> get v8 => const fb.ListReader<int>(const fb.Int8Reader()).vTableGet(_bc, _bcOffset, 24, null); 1323 List<double> get vf64 => const fb.ListReader<double>(const fb.Float64Reader()).vTableGet(_bc, _bcOffset, 26, null); 1324 1325 @override 1326 String toString() { 1327 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}'; 1328 } 1329} 1330 1331class _TypeAliasesReader extends fb.TableReader<TypeAliases> { 1332 const _TypeAliasesReader(); 1333 1334 @override 1335 TypeAliases createObject(fb.BufferContext bc, int offset) => 1336 new TypeAliases._(bc, offset); 1337} 1338 1339class TypeAliasesBuilder { 1340 TypeAliasesBuilder(this.fbBuilder) { 1341 assert(fbBuilder != null); 1342 } 1343 1344 final fb.Builder fbBuilder; 1345 1346 void begin() { 1347 fbBuilder.startTable(); 1348 } 1349 1350 int addI8(int i8) { 1351 fbBuilder.addInt8(0, i8); 1352 return fbBuilder.offset; 1353 } 1354 int addU8(int u8) { 1355 fbBuilder.addUint8(1, u8); 1356 return fbBuilder.offset; 1357 } 1358 int addI16(int i16) { 1359 fbBuilder.addInt16(2, i16); 1360 return fbBuilder.offset; 1361 } 1362 int addU16(int u16) { 1363 fbBuilder.addUint16(3, u16); 1364 return fbBuilder.offset; 1365 } 1366 int addI32(int i32) { 1367 fbBuilder.addInt32(4, i32); 1368 return fbBuilder.offset; 1369 } 1370 int addU32(int u32) { 1371 fbBuilder.addUint32(5, u32); 1372 return fbBuilder.offset; 1373 } 1374 int addI64(int i64) { 1375 fbBuilder.addInt64(6, i64); 1376 return fbBuilder.offset; 1377 } 1378 int addU64(int u64) { 1379 fbBuilder.addUint64(7, u64); 1380 return fbBuilder.offset; 1381 } 1382 int addF32(double f32) { 1383 fbBuilder.addFloat32(8, f32); 1384 return fbBuilder.offset; 1385 } 1386 int addF64(double f64) { 1387 fbBuilder.addFloat64(9, f64); 1388 return fbBuilder.offset; 1389 } 1390 int addV8Offset(int offset) { 1391 fbBuilder.addOffset(10, offset); 1392 return fbBuilder.offset; 1393 } 1394 int addVf64Offset(int offset) { 1395 fbBuilder.addOffset(11, offset); 1396 return fbBuilder.offset; 1397 } 1398 1399 int finish() { 1400 return fbBuilder.endTable(); 1401 } 1402} 1403 1404class TypeAliasesObjectBuilder extends fb.ObjectBuilder { 1405 final int _i8; 1406 final int _u8; 1407 final int _i16; 1408 final int _u16; 1409 final int _i32; 1410 final int _u32; 1411 final int _i64; 1412 final int _u64; 1413 final double _f32; 1414 final double _f64; 1415 final List<int> _v8; 1416 final List<double> _vf64; 1417 1418 TypeAliasesObjectBuilder({ 1419 int i8, 1420 int u8, 1421 int i16, 1422 int u16, 1423 int i32, 1424 int u32, 1425 int i64, 1426 int u64, 1427 double f32, 1428 double f64, 1429 List<int> v8, 1430 List<double> vf64, 1431 }) 1432 : _i8 = i8, 1433 _u8 = u8, 1434 _i16 = i16, 1435 _u16 = u16, 1436 _i32 = i32, 1437 _u32 = u32, 1438 _i64 = i64, 1439 _u64 = u64, 1440 _f32 = f32, 1441 _f64 = f64, 1442 _v8 = v8, 1443 _vf64 = vf64; 1444 1445 /// Finish building, and store into the [fbBuilder]. 1446 @override 1447 int finish( 1448 fb.Builder fbBuilder) { 1449 assert(fbBuilder != null); 1450 final int v8Offset = _v8?.isNotEmpty == true 1451 ? fbBuilder.writeListInt8(_v8) 1452 : null; 1453 final int vf64Offset = _vf64?.isNotEmpty == true 1454 ? fbBuilder.writeListFloat64(_vf64) 1455 : null; 1456 1457 fbBuilder.startTable(); 1458 fbBuilder.addInt8(0, _i8); 1459 fbBuilder.addUint8(1, _u8); 1460 fbBuilder.addInt16(2, _i16); 1461 fbBuilder.addUint16(3, _u16); 1462 fbBuilder.addInt32(4, _i32); 1463 fbBuilder.addUint32(5, _u32); 1464 fbBuilder.addInt64(6, _i64); 1465 fbBuilder.addUint64(7, _u64); 1466 fbBuilder.addFloat32(8, _f32); 1467 fbBuilder.addFloat64(9, _f64); 1468 if (v8Offset != null) { 1469 fbBuilder.addOffset(10, v8Offset); 1470 } 1471 if (vf64Offset != null) { 1472 fbBuilder.addOffset(11, vf64Offset); 1473 } 1474 return fbBuilder.endTable(); 1475 } 1476 1477 /// Convenience method to serialize to byte list. 1478 @override 1479 Uint8List toBytes([String fileIdentifier]) { 1480 fb.Builder fbBuilder = new fb.Builder(); 1481 int offset = finish(fbBuilder); 1482 return fbBuilder.finish(offset, fileIdentifier); 1483 } 1484} 1485