1// automatically generated by the FlatBuffers compiler, do not modify 2 3/** 4 * @enum 5 */ 6export namespace MyGame.Example{ 7export enum Color{ 8 Red= 1, 9 Green= 2, 10 Blue= 8 11}}; 12 13/** 14 * @enum 15 */ 16export namespace MyGame.Example{ 17export enum Any{ 18 NONE= 0, 19 Monster= 1, 20 TestSimpleTableWithEnum= 2, 21 MyGame_Example2_Monster= 3 22}}; 23 24/** 25 * @enum 26 */ 27export namespace MyGame.Example{ 28export enum AnyUniqueAliases{ 29 NONE= 0, 30 M= 1, 31 T= 2, 32 M2= 3 33}}; 34 35/** 36 * @enum 37 */ 38export namespace MyGame.Example{ 39export enum AnyAmbiguousAliases{ 40 NONE= 0, 41 M1= 1, 42 M2= 2, 43 M3= 3 44}}; 45 46/** 47 * @constructor 48 */ 49export namespace MyGame{ 50export class InParentNamespace { 51 bb: flatbuffers.ByteBuffer|null = null; 52 53 bb_pos:number = 0; 54/** 55 * @param number i 56 * @param flatbuffers.ByteBuffer bb 57 * @returns InParentNamespace 58 */ 59__init(i:number, bb:flatbuffers.ByteBuffer):InParentNamespace { 60 this.bb_pos = i; 61 this.bb = bb; 62 return this; 63}; 64 65/** 66 * @param flatbuffers.ByteBuffer bb 67 * @param InParentNamespace= obj 68 * @returns InParentNamespace 69 */ 70static getRootAsInParentNamespace(bb:flatbuffers.ByteBuffer, obj?:InParentNamespace):InParentNamespace { 71 return (obj || new InParentNamespace).__init(bb.readInt32(bb.position()) + bb.position(), bb); 72}; 73 74/** 75 * @param flatbuffers.Builder builder 76 */ 77static startInParentNamespace(builder:flatbuffers.Builder) { 78 builder.startObject(0); 79}; 80 81/** 82 * @param flatbuffers.Builder builder 83 * @returns flatbuffers.Offset 84 */ 85static endInParentNamespace(builder:flatbuffers.Builder):flatbuffers.Offset { 86 var offset = builder.endObject(); 87 return offset; 88}; 89 90static createInParentNamespace(builder:flatbuffers.Builder):flatbuffers.Offset { 91 InParentNamespace.startInParentNamespace(builder); 92 return InParentNamespace.endInParentNamespace(builder); 93} 94} 95} 96/** 97 * @constructor 98 */ 99export namespace MyGame.Example2{ 100export class Monster { 101 bb: flatbuffers.ByteBuffer|null = null; 102 103 bb_pos:number = 0; 104/** 105 * @param number i 106 * @param flatbuffers.ByteBuffer bb 107 * @returns Monster 108 */ 109__init(i:number, bb:flatbuffers.ByteBuffer):Monster { 110 this.bb_pos = i; 111 this.bb = bb; 112 return this; 113}; 114 115/** 116 * @param flatbuffers.ByteBuffer bb 117 * @param Monster= obj 118 * @returns Monster 119 */ 120static getRootAsMonster(bb:flatbuffers.ByteBuffer, obj?:Monster):Monster { 121 return (obj || new Monster).__init(bb.readInt32(bb.position()) + bb.position(), bb); 122}; 123 124/** 125 * @param flatbuffers.Builder builder 126 */ 127static startMonster(builder:flatbuffers.Builder) { 128 builder.startObject(0); 129}; 130 131/** 132 * @param flatbuffers.Builder builder 133 * @returns flatbuffers.Offset 134 */ 135static endMonster(builder:flatbuffers.Builder):flatbuffers.Offset { 136 var offset = builder.endObject(); 137 return offset; 138}; 139 140static createMonster(builder:flatbuffers.Builder):flatbuffers.Offset { 141 Monster.startMonster(builder); 142 return Monster.endMonster(builder); 143} 144} 145} 146/** 147 * @constructor 148 */ 149export namespace MyGame.Example{ 150export class Test { 151 bb: flatbuffers.ByteBuffer|null = null; 152 153 bb_pos:number = 0; 154/** 155 * @param number i 156 * @param flatbuffers.ByteBuffer bb 157 * @returns Test 158 */ 159__init(i:number, bb:flatbuffers.ByteBuffer):Test { 160 this.bb_pos = i; 161 this.bb = bb; 162 return this; 163}; 164 165/** 166 * @returns number 167 */ 168a():number { 169 return this.bb!.readInt16(this.bb_pos); 170}; 171 172/** 173 * @param number value 174 * @returns boolean 175 */ 176mutate_a(value:number):boolean { 177 var offset = this.bb!.__offset(this.bb_pos, 0); 178 179 if (offset === 0) { 180 return false; 181 } 182 183 this.bb!.writeInt16(this.bb_pos + offset, value); 184 return true; 185}; 186 187/** 188 * @returns number 189 */ 190b():number { 191 return this.bb!.readInt8(this.bb_pos + 2); 192}; 193 194/** 195 * @param number value 196 * @returns boolean 197 */ 198mutate_b(value:number):boolean { 199 var offset = this.bb!.__offset(this.bb_pos, 2); 200 201 if (offset === 0) { 202 return false; 203 } 204 205 this.bb!.writeInt8(this.bb_pos + offset, value); 206 return true; 207}; 208 209/** 210 * @param flatbuffers.Builder builder 211 * @param number a 212 * @param number b 213 * @returns flatbuffers.Offset 214 */ 215static createTest(builder:flatbuffers.Builder, a: number, b: number):flatbuffers.Offset { 216 builder.prep(2, 4); 217 builder.pad(1); 218 builder.writeInt8(b); 219 builder.writeInt16(a); 220 return builder.offset(); 221}; 222 223} 224} 225/** 226 * @constructor 227 */ 228export namespace MyGame.Example{ 229export class TestSimpleTableWithEnum { 230 bb: flatbuffers.ByteBuffer|null = null; 231 232 bb_pos:number = 0; 233/** 234 * @param number i 235 * @param flatbuffers.ByteBuffer bb 236 * @returns TestSimpleTableWithEnum 237 */ 238__init(i:number, bb:flatbuffers.ByteBuffer):TestSimpleTableWithEnum { 239 this.bb_pos = i; 240 this.bb = bb; 241 return this; 242}; 243 244/** 245 * @param flatbuffers.ByteBuffer bb 246 * @param TestSimpleTableWithEnum= obj 247 * @returns TestSimpleTableWithEnum 248 */ 249static getRootAsTestSimpleTableWithEnum(bb:flatbuffers.ByteBuffer, obj?:TestSimpleTableWithEnum):TestSimpleTableWithEnum { 250 return (obj || new TestSimpleTableWithEnum).__init(bb.readInt32(bb.position()) + bb.position(), bb); 251}; 252 253/** 254 * @returns MyGame.Example.Color 255 */ 256color():MyGame.Example.Color { 257 var offset = this.bb!.__offset(this.bb_pos, 4); 258 return offset ? /** */ (this.bb!.readInt8(this.bb_pos + offset)) : MyGame.Example.Color.Green; 259}; 260 261/** 262 * @param MyGame.Example.Color value 263 * @returns boolean 264 */ 265mutate_color(value:MyGame.Example.Color):boolean { 266 var offset = this.bb!.__offset(this.bb_pos, 4); 267 268 if (offset === 0) { 269 return false; 270 } 271 272 this.bb!.writeInt8(this.bb_pos + offset, value); 273 return true; 274}; 275 276/** 277 * @param flatbuffers.Builder builder 278 */ 279static startTestSimpleTableWithEnum(builder:flatbuffers.Builder) { 280 builder.startObject(1); 281}; 282 283/** 284 * @param flatbuffers.Builder builder 285 * @param MyGame.Example.Color color 286 */ 287static addColor(builder:flatbuffers.Builder, color:MyGame.Example.Color) { 288 builder.addFieldInt8(0, color, MyGame.Example.Color.Green); 289}; 290 291/** 292 * @param flatbuffers.Builder builder 293 * @returns flatbuffers.Offset 294 */ 295static endTestSimpleTableWithEnum(builder:flatbuffers.Builder):flatbuffers.Offset { 296 var offset = builder.endObject(); 297 return offset; 298}; 299 300static createTestSimpleTableWithEnum(builder:flatbuffers.Builder, color:MyGame.Example.Color):flatbuffers.Offset { 301 TestSimpleTableWithEnum.startTestSimpleTableWithEnum(builder); 302 TestSimpleTableWithEnum.addColor(builder, color); 303 return TestSimpleTableWithEnum.endTestSimpleTableWithEnum(builder); 304} 305} 306} 307/** 308 * @constructor 309 */ 310export namespace MyGame.Example{ 311export class Vec3 { 312 bb: flatbuffers.ByteBuffer|null = null; 313 314 bb_pos:number = 0; 315/** 316 * @param number i 317 * @param flatbuffers.ByteBuffer bb 318 * @returns Vec3 319 */ 320__init(i:number, bb:flatbuffers.ByteBuffer):Vec3 { 321 this.bb_pos = i; 322 this.bb = bb; 323 return this; 324}; 325 326/** 327 * @returns number 328 */ 329x():number { 330 return this.bb!.readFloat32(this.bb_pos); 331}; 332 333/** 334 * @param number value 335 * @returns boolean 336 */ 337mutate_x(value:number):boolean { 338 var offset = this.bb!.__offset(this.bb_pos, 0); 339 340 if (offset === 0) { 341 return false; 342 } 343 344 this.bb!.writeFloat32(this.bb_pos + offset, value); 345 return true; 346}; 347 348/** 349 * @returns number 350 */ 351y():number { 352 return this.bb!.readFloat32(this.bb_pos + 4); 353}; 354 355/** 356 * @param number value 357 * @returns boolean 358 */ 359mutate_y(value:number):boolean { 360 var offset = this.bb!.__offset(this.bb_pos, 4); 361 362 if (offset === 0) { 363 return false; 364 } 365 366 this.bb!.writeFloat32(this.bb_pos + offset, value); 367 return true; 368}; 369 370/** 371 * @returns number 372 */ 373z():number { 374 return this.bb!.readFloat32(this.bb_pos + 8); 375}; 376 377/** 378 * @param number value 379 * @returns boolean 380 */ 381mutate_z(value:number):boolean { 382 var offset = this.bb!.__offset(this.bb_pos, 8); 383 384 if (offset === 0) { 385 return false; 386 } 387 388 this.bb!.writeFloat32(this.bb_pos + offset, value); 389 return true; 390}; 391 392/** 393 * @returns number 394 */ 395test1():number { 396 return this.bb!.readFloat64(this.bb_pos + 16); 397}; 398 399/** 400 * @param number value 401 * @returns boolean 402 */ 403mutate_test1(value:number):boolean { 404 var offset = this.bb!.__offset(this.bb_pos, 16); 405 406 if (offset === 0) { 407 return false; 408 } 409 410 this.bb!.writeFloat64(this.bb_pos + offset, value); 411 return true; 412}; 413 414/** 415 * @returns MyGame.Example.Color 416 */ 417test2():MyGame.Example.Color { 418 return /** */ (this.bb!.readInt8(this.bb_pos + 24)); 419}; 420 421/** 422 * @param MyGame.Example.Color value 423 * @returns boolean 424 */ 425mutate_test2(value:MyGame.Example.Color):boolean { 426 var offset = this.bb!.__offset(this.bb_pos, 24); 427 428 if (offset === 0) { 429 return false; 430 } 431 432 this.bb!.writeInt8(this.bb_pos + offset, value); 433 return true; 434}; 435 436/** 437 * @param MyGame.Example.Test= obj 438 * @returns MyGame.Example.Test|null 439 */ 440test3(obj?:MyGame.Example.Test):MyGame.Example.Test|null { 441 return (obj || new MyGame.Example.Test).__init(this.bb_pos + 26, this.bb!); 442}; 443 444/** 445 * @param flatbuffers.Builder builder 446 * @param number x 447 * @param number y 448 * @param number z 449 * @param number test1 450 * @param MyGame.Example.Color test2 451 * @param number test3_a 452 * @param number test3_b 453 * @returns flatbuffers.Offset 454 */ 455static createVec3(builder:flatbuffers.Builder, x: number, y: number, z: number, test1: number, test2: MyGame.Example.Color, test3_a: number, test3_b: number):flatbuffers.Offset { 456 builder.prep(8, 32); 457 builder.pad(2); 458 builder.prep(2, 4); 459 builder.pad(1); 460 builder.writeInt8(test3_b); 461 builder.writeInt16(test3_a); 462 builder.pad(1); 463 builder.writeInt8(test2); 464 builder.writeFloat64(test1); 465 builder.pad(4); 466 builder.writeFloat32(z); 467 builder.writeFloat32(y); 468 builder.writeFloat32(x); 469 return builder.offset(); 470}; 471 472} 473} 474/** 475 * @constructor 476 */ 477export namespace MyGame.Example{ 478export class Ability { 479 bb: flatbuffers.ByteBuffer|null = null; 480 481 bb_pos:number = 0; 482/** 483 * @param number i 484 * @param flatbuffers.ByteBuffer bb 485 * @returns Ability 486 */ 487__init(i:number, bb:flatbuffers.ByteBuffer):Ability { 488 this.bb_pos = i; 489 this.bb = bb; 490 return this; 491}; 492 493/** 494 * @returns number 495 */ 496id():number { 497 return this.bb!.readUint32(this.bb_pos); 498}; 499 500/** 501 * @param number value 502 * @returns boolean 503 */ 504mutate_id(value:number):boolean { 505 var offset = this.bb!.__offset(this.bb_pos, 0); 506 507 if (offset === 0) { 508 return false; 509 } 510 511 this.bb!.writeUint32(this.bb_pos + offset, value); 512 return true; 513}; 514 515/** 516 * @returns number 517 */ 518distance():number { 519 return this.bb!.readUint32(this.bb_pos + 4); 520}; 521 522/** 523 * @param number value 524 * @returns boolean 525 */ 526mutate_distance(value:number):boolean { 527 var offset = this.bb!.__offset(this.bb_pos, 4); 528 529 if (offset === 0) { 530 return false; 531 } 532 533 this.bb!.writeUint32(this.bb_pos + offset, value); 534 return true; 535}; 536 537/** 538 * @param flatbuffers.Builder builder 539 * @param number id 540 * @param number distance 541 * @returns flatbuffers.Offset 542 */ 543static createAbility(builder:flatbuffers.Builder, id: number, distance: number):flatbuffers.Offset { 544 builder.prep(4, 8); 545 builder.writeInt32(distance); 546 builder.writeInt32(id); 547 return builder.offset(); 548}; 549 550} 551} 552/** 553 * @constructor 554 */ 555export namespace MyGame.Example{ 556export class Stat { 557 bb: flatbuffers.ByteBuffer|null = null; 558 559 bb_pos:number = 0; 560/** 561 * @param number i 562 * @param flatbuffers.ByteBuffer bb 563 * @returns Stat 564 */ 565__init(i:number, bb:flatbuffers.ByteBuffer):Stat { 566 this.bb_pos = i; 567 this.bb = bb; 568 return this; 569}; 570 571/** 572 * @param flatbuffers.ByteBuffer bb 573 * @param Stat= obj 574 * @returns Stat 575 */ 576static getRootAsStat(bb:flatbuffers.ByteBuffer, obj?:Stat):Stat { 577 return (obj || new Stat).__init(bb.readInt32(bb.position()) + bb.position(), bb); 578}; 579 580/** 581 * @param flatbuffers.Encoding= optionalEncoding 582 * @returns string|Uint8Array|null 583 */ 584id():string|null 585id(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null 586id(optionalEncoding?:any):string|Uint8Array|null { 587 var offset = this.bb!.__offset(this.bb_pos, 4); 588 return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null; 589}; 590 591/** 592 * @returns flatbuffers.Long 593 */ 594val():flatbuffers.Long { 595 var offset = this.bb!.__offset(this.bb_pos, 6); 596 return offset ? this.bb!.readInt64(this.bb_pos + offset) : this.bb!.createLong(0, 0); 597}; 598 599/** 600 * @param flatbuffers.Long value 601 * @returns boolean 602 */ 603mutate_val(value:flatbuffers.Long):boolean { 604 var offset = this.bb!.__offset(this.bb_pos, 6); 605 606 if (offset === 0) { 607 return false; 608 } 609 610 this.bb!.writeInt64(this.bb_pos + offset, value); 611 return true; 612}; 613 614/** 615 * @returns number 616 */ 617count():number { 618 var offset = this.bb!.__offset(this.bb_pos, 8); 619 return offset ? this.bb!.readUint16(this.bb_pos + offset) : 0; 620}; 621 622/** 623 * @param number value 624 * @returns boolean 625 */ 626mutate_count(value:number):boolean { 627 var offset = this.bb!.__offset(this.bb_pos, 8); 628 629 if (offset === 0) { 630 return false; 631 } 632 633 this.bb!.writeUint16(this.bb_pos + offset, value); 634 return true; 635}; 636 637/** 638 * @param flatbuffers.Builder builder 639 */ 640static startStat(builder:flatbuffers.Builder) { 641 builder.startObject(3); 642}; 643 644/** 645 * @param flatbuffers.Builder builder 646 * @param flatbuffers.Offset idOffset 647 */ 648static addId(builder:flatbuffers.Builder, idOffset:flatbuffers.Offset) { 649 builder.addFieldOffset(0, idOffset, 0); 650}; 651 652/** 653 * @param flatbuffers.Builder builder 654 * @param flatbuffers.Long val 655 */ 656static addVal(builder:flatbuffers.Builder, val:flatbuffers.Long) { 657 builder.addFieldInt64(1, val, builder.createLong(0, 0)); 658}; 659 660/** 661 * @param flatbuffers.Builder builder 662 * @param number count 663 */ 664static addCount(builder:flatbuffers.Builder, count:number) { 665 builder.addFieldInt16(2, count, 0); 666}; 667 668/** 669 * @param flatbuffers.Builder builder 670 * @returns flatbuffers.Offset 671 */ 672static endStat(builder:flatbuffers.Builder):flatbuffers.Offset { 673 var offset = builder.endObject(); 674 return offset; 675}; 676 677static createStat(builder:flatbuffers.Builder, idOffset:flatbuffers.Offset, val:flatbuffers.Long, count:number):flatbuffers.Offset { 678 Stat.startStat(builder); 679 Stat.addId(builder, idOffset); 680 Stat.addVal(builder, val); 681 Stat.addCount(builder, count); 682 return Stat.endStat(builder); 683} 684} 685} 686/** 687 * @constructor 688 */ 689export namespace MyGame.Example{ 690export class Referrable { 691 bb: flatbuffers.ByteBuffer|null = null; 692 693 bb_pos:number = 0; 694/** 695 * @param number i 696 * @param flatbuffers.ByteBuffer bb 697 * @returns Referrable 698 */ 699__init(i:number, bb:flatbuffers.ByteBuffer):Referrable { 700 this.bb_pos = i; 701 this.bb = bb; 702 return this; 703}; 704 705/** 706 * @param flatbuffers.ByteBuffer bb 707 * @param Referrable= obj 708 * @returns Referrable 709 */ 710static getRootAsReferrable(bb:flatbuffers.ByteBuffer, obj?:Referrable):Referrable { 711 return (obj || new Referrable).__init(bb.readInt32(bb.position()) + bb.position(), bb); 712}; 713 714/** 715 * @returns flatbuffers.Long 716 */ 717id():flatbuffers.Long { 718 var offset = this.bb!.__offset(this.bb_pos, 4); 719 return offset ? this.bb!.readUint64(this.bb_pos + offset) : this.bb!.createLong(0, 0); 720}; 721 722/** 723 * @param flatbuffers.Long value 724 * @returns boolean 725 */ 726mutate_id(value:flatbuffers.Long):boolean { 727 var offset = this.bb!.__offset(this.bb_pos, 4); 728 729 if (offset === 0) { 730 return false; 731 } 732 733 this.bb!.writeUint64(this.bb_pos + offset, value); 734 return true; 735}; 736 737/** 738 * @param flatbuffers.Builder builder 739 */ 740static startReferrable(builder:flatbuffers.Builder) { 741 builder.startObject(1); 742}; 743 744/** 745 * @param flatbuffers.Builder builder 746 * @param flatbuffers.Long id 747 */ 748static addId(builder:flatbuffers.Builder, id:flatbuffers.Long) { 749 builder.addFieldInt64(0, id, builder.createLong(0, 0)); 750}; 751 752/** 753 * @param flatbuffers.Builder builder 754 * @returns flatbuffers.Offset 755 */ 756static endReferrable(builder:flatbuffers.Builder):flatbuffers.Offset { 757 var offset = builder.endObject(); 758 return offset; 759}; 760 761static createReferrable(builder:flatbuffers.Builder, id:flatbuffers.Long):flatbuffers.Offset { 762 Referrable.startReferrable(builder); 763 Referrable.addId(builder, id); 764 return Referrable.endReferrable(builder); 765} 766} 767} 768/** 769 * an example documentation comment: monster object 770 * 771 * @constructor 772 */ 773export namespace MyGame.Example{ 774export class Monster { 775 bb: flatbuffers.ByteBuffer|null = null; 776 777 bb_pos:number = 0; 778/** 779 * @param number i 780 * @param flatbuffers.ByteBuffer bb 781 * @returns Monster 782 */ 783__init(i:number, bb:flatbuffers.ByteBuffer):Monster { 784 this.bb_pos = i; 785 this.bb = bb; 786 return this; 787}; 788 789/** 790 * @param flatbuffers.ByteBuffer bb 791 * @param Monster= obj 792 * @returns Monster 793 */ 794static getRootAsMonster(bb:flatbuffers.ByteBuffer, obj?:Monster):Monster { 795 return (obj || new Monster).__init(bb.readInt32(bb.position()) + bb.position(), bb); 796}; 797 798/** 799 * @param flatbuffers.ByteBuffer bb 800 * @returns boolean 801 */ 802static bufferHasIdentifier(bb:flatbuffers.ByteBuffer):boolean { 803 return bb.__has_identifier('MONS'); 804}; 805 806/** 807 * @param MyGame.Example.Vec3= obj 808 * @returns MyGame.Example.Vec3|null 809 */ 810pos(obj?:MyGame.Example.Vec3):MyGame.Example.Vec3|null { 811 var offset = this.bb!.__offset(this.bb_pos, 4); 812 return offset ? (obj || new MyGame.Example.Vec3).__init(this.bb_pos + offset, this.bb!) : null; 813}; 814 815/** 816 * @returns number 817 */ 818mana():number { 819 var offset = this.bb!.__offset(this.bb_pos, 6); 820 return offset ? this.bb!.readInt16(this.bb_pos + offset) : 150; 821}; 822 823/** 824 * @param number value 825 * @returns boolean 826 */ 827mutate_mana(value:number):boolean { 828 var offset = this.bb!.__offset(this.bb_pos, 6); 829 830 if (offset === 0) { 831 return false; 832 } 833 834 this.bb!.writeInt16(this.bb_pos + offset, value); 835 return true; 836}; 837 838/** 839 * @returns number 840 */ 841hp():number { 842 var offset = this.bb!.__offset(this.bb_pos, 8); 843 return offset ? this.bb!.readInt16(this.bb_pos + offset) : 100; 844}; 845 846/** 847 * @param number value 848 * @returns boolean 849 */ 850mutate_hp(value:number):boolean { 851 var offset = this.bb!.__offset(this.bb_pos, 8); 852 853 if (offset === 0) { 854 return false; 855 } 856 857 this.bb!.writeInt16(this.bb_pos + offset, value); 858 return true; 859}; 860 861/** 862 * @param flatbuffers.Encoding= optionalEncoding 863 * @returns string|Uint8Array|null 864 */ 865name():string|null 866name(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null 867name(optionalEncoding?:any):string|Uint8Array|null { 868 var offset = this.bb!.__offset(this.bb_pos, 10); 869 return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null; 870}; 871 872/** 873 * @param number index 874 * @returns number 875 */ 876inventory(index: number):number|null { 877 var offset = this.bb!.__offset(this.bb_pos, 14); 878 return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0; 879}; 880 881/** 882 * @returns number 883 */ 884inventoryLength():number { 885 var offset = this.bb!.__offset(this.bb_pos, 14); 886 return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; 887}; 888 889/** 890 * @returns Uint8Array 891 */ 892inventoryArray():Uint8Array|null { 893 var offset = this.bb!.__offset(this.bb_pos, 14); 894 return offset ? new Uint8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null; 895}; 896 897/** 898 * @returns MyGame.Example.Color 899 */ 900color():MyGame.Example.Color { 901 var offset = this.bb!.__offset(this.bb_pos, 16); 902 return offset ? /** */ (this.bb!.readInt8(this.bb_pos + offset)) : MyGame.Example.Color.Blue; 903}; 904 905/** 906 * @param MyGame.Example.Color value 907 * @returns boolean 908 */ 909mutate_color(value:MyGame.Example.Color):boolean { 910 var offset = this.bb!.__offset(this.bb_pos, 16); 911 912 if (offset === 0) { 913 return false; 914 } 915 916 this.bb!.writeInt8(this.bb_pos + offset, value); 917 return true; 918}; 919 920/** 921 * @returns MyGame.Example.Any 922 */ 923testType():MyGame.Example.Any { 924 var offset = this.bb!.__offset(this.bb_pos, 18); 925 return offset ? /** */ (this.bb!.readUint8(this.bb_pos + offset)) : MyGame.Example.Any.NONE; 926}; 927 928/** 929 * @param MyGame.Example.Any value 930 * @returns boolean 931 */ 932mutate_test_type(value:MyGame.Example.Any):boolean { 933 var offset = this.bb!.__offset(this.bb_pos, 18); 934 935 if (offset === 0) { 936 return false; 937 } 938 939 this.bb!.writeUint8(this.bb_pos + offset, value); 940 return true; 941}; 942 943/** 944 * @param flatbuffers.Table obj 945 * @returns ?flatbuffers.Table 946 */ 947test<T extends flatbuffers.Table>(obj:T):T|null { 948 var offset = this.bb!.__offset(this.bb_pos, 20); 949 return offset ? this.bb!.__union(obj, this.bb_pos + offset) : null; 950}; 951 952/** 953 * @param number index 954 * @param MyGame.Example.Test= obj 955 * @returns MyGame.Example.Test 956 */ 957test4(index: number, obj?:MyGame.Example.Test):MyGame.Example.Test|null { 958 var offset = this.bb!.__offset(this.bb_pos, 22); 959 return offset ? (obj || new MyGame.Example.Test).__init(this.bb!.__vector(this.bb_pos + offset) + index * 4, this.bb!) : null; 960}; 961 962/** 963 * @returns number 964 */ 965test4Length():number { 966 var offset = this.bb!.__offset(this.bb_pos, 22); 967 return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; 968}; 969 970/** 971 * @param number index 972 * @param flatbuffers.Encoding= optionalEncoding 973 * @returns string|Uint8Array 974 */ 975testarrayofstring(index: number):string 976testarrayofstring(index: number,optionalEncoding:flatbuffers.Encoding):string|Uint8Array 977testarrayofstring(index: number,optionalEncoding?:any):string|Uint8Array|null { 978 var offset = this.bb!.__offset(this.bb_pos, 24); 979 return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null; 980}; 981 982/** 983 * @returns number 984 */ 985testarrayofstringLength():number { 986 var offset = this.bb!.__offset(this.bb_pos, 24); 987 return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; 988}; 989 990/** 991 * an example documentation comment: this will end up in the generated code 992 * multiline too 993 * 994 * @param number index 995 * @param MyGame.Example.Monster= obj 996 * @returns MyGame.Example.Monster 997 */ 998testarrayoftables(index: number, obj?:MyGame.Example.Monster):MyGame.Example.Monster|null { 999 var offset = this.bb!.__offset(this.bb_pos, 26); 1000 return offset ? (obj || new MyGame.Example.Monster).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null; 1001}; 1002 1003/** 1004 * @returns number 1005 */ 1006testarrayoftablesLength():number { 1007 var offset = this.bb!.__offset(this.bb_pos, 26); 1008 return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; 1009}; 1010 1011/** 1012 * @param MyGame.Example.Monster= obj 1013 * @returns MyGame.Example.Monster|null 1014 */ 1015enemy(obj?:MyGame.Example.Monster):MyGame.Example.Monster|null { 1016 var offset = this.bb!.__offset(this.bb_pos, 28); 1017 return offset ? (obj || new MyGame.Example.Monster).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null; 1018}; 1019 1020/** 1021 * @param number index 1022 * @returns number 1023 */ 1024testnestedflatbuffer(index: number):number|null { 1025 var offset = this.bb!.__offset(this.bb_pos, 30); 1026 return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0; 1027}; 1028 1029/** 1030 * @returns number 1031 */ 1032testnestedflatbufferLength():number { 1033 var offset = this.bb!.__offset(this.bb_pos, 30); 1034 return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; 1035}; 1036 1037/** 1038 * @returns Uint8Array 1039 */ 1040testnestedflatbufferArray():Uint8Array|null { 1041 var offset = this.bb!.__offset(this.bb_pos, 30); 1042 return offset ? new Uint8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null; 1043}; 1044 1045/** 1046 * @param MyGame.Example.Stat= obj 1047 * @returns MyGame.Example.Stat|null 1048 */ 1049testempty(obj?:MyGame.Example.Stat):MyGame.Example.Stat|null { 1050 var offset = this.bb!.__offset(this.bb_pos, 32); 1051 return offset ? (obj || new MyGame.Example.Stat).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null; 1052}; 1053 1054/** 1055 * @returns boolean 1056 */ 1057testbool():boolean { 1058 var offset = this.bb!.__offset(this.bb_pos, 34); 1059 return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false; 1060}; 1061 1062/** 1063 * @param boolean value 1064 * @returns boolean 1065 */ 1066mutate_testbool(value:boolean):boolean { 1067 var offset = this.bb!.__offset(this.bb_pos, 34); 1068 1069 if (offset === 0) { 1070 return false; 1071 } 1072 1073 this.bb!.writeInt8(this.bb_pos + offset, +value); 1074 return true; 1075}; 1076 1077/** 1078 * @returns number 1079 */ 1080testhashs32Fnv1():number { 1081 var offset = this.bb!.__offset(this.bb_pos, 36); 1082 return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0; 1083}; 1084 1085/** 1086 * @param number value 1087 * @returns boolean 1088 */ 1089mutate_testhashs32_fnv1(value:number):boolean { 1090 var offset = this.bb!.__offset(this.bb_pos, 36); 1091 1092 if (offset === 0) { 1093 return false; 1094 } 1095 1096 this.bb!.writeInt32(this.bb_pos + offset, value); 1097 return true; 1098}; 1099 1100/** 1101 * @returns number 1102 */ 1103testhashu32Fnv1():number { 1104 var offset = this.bb!.__offset(this.bb_pos, 38); 1105 return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0; 1106}; 1107 1108/** 1109 * @param number value 1110 * @returns boolean 1111 */ 1112mutate_testhashu32_fnv1(value:number):boolean { 1113 var offset = this.bb!.__offset(this.bb_pos, 38); 1114 1115 if (offset === 0) { 1116 return false; 1117 } 1118 1119 this.bb!.writeUint32(this.bb_pos + offset, value); 1120 return true; 1121}; 1122 1123/** 1124 * @returns flatbuffers.Long 1125 */ 1126testhashs64Fnv1():flatbuffers.Long { 1127 var offset = this.bb!.__offset(this.bb_pos, 40); 1128 return offset ? this.bb!.readInt64(this.bb_pos + offset) : this.bb!.createLong(0, 0); 1129}; 1130 1131/** 1132 * @param flatbuffers.Long value 1133 * @returns boolean 1134 */ 1135mutate_testhashs64_fnv1(value:flatbuffers.Long):boolean { 1136 var offset = this.bb!.__offset(this.bb_pos, 40); 1137 1138 if (offset === 0) { 1139 return false; 1140 } 1141 1142 this.bb!.writeInt64(this.bb_pos + offset, value); 1143 return true; 1144}; 1145 1146/** 1147 * @returns flatbuffers.Long 1148 */ 1149testhashu64Fnv1():flatbuffers.Long { 1150 var offset = this.bb!.__offset(this.bb_pos, 42); 1151 return offset ? this.bb!.readUint64(this.bb_pos + offset) : this.bb!.createLong(0, 0); 1152}; 1153 1154/** 1155 * @param flatbuffers.Long value 1156 * @returns boolean 1157 */ 1158mutate_testhashu64_fnv1(value:flatbuffers.Long):boolean { 1159 var offset = this.bb!.__offset(this.bb_pos, 42); 1160 1161 if (offset === 0) { 1162 return false; 1163 } 1164 1165 this.bb!.writeUint64(this.bb_pos + offset, value); 1166 return true; 1167}; 1168 1169/** 1170 * @returns number 1171 */ 1172testhashs32Fnv1a():number { 1173 var offset = this.bb!.__offset(this.bb_pos, 44); 1174 return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0; 1175}; 1176 1177/** 1178 * @param number value 1179 * @returns boolean 1180 */ 1181mutate_testhashs32_fnv1a(value:number):boolean { 1182 var offset = this.bb!.__offset(this.bb_pos, 44); 1183 1184 if (offset === 0) { 1185 return false; 1186 } 1187 1188 this.bb!.writeInt32(this.bb_pos + offset, value); 1189 return true; 1190}; 1191 1192/** 1193 * @returns number 1194 */ 1195testhashu32Fnv1a():number { 1196 var offset = this.bb!.__offset(this.bb_pos, 46); 1197 return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0; 1198}; 1199 1200/** 1201 * @param number value 1202 * @returns boolean 1203 */ 1204mutate_testhashu32_fnv1a(value:number):boolean { 1205 var offset = this.bb!.__offset(this.bb_pos, 46); 1206 1207 if (offset === 0) { 1208 return false; 1209 } 1210 1211 this.bb!.writeUint32(this.bb_pos + offset, value); 1212 return true; 1213}; 1214 1215/** 1216 * @returns flatbuffers.Long 1217 */ 1218testhashs64Fnv1a():flatbuffers.Long { 1219 var offset = this.bb!.__offset(this.bb_pos, 48); 1220 return offset ? this.bb!.readInt64(this.bb_pos + offset) : this.bb!.createLong(0, 0); 1221}; 1222 1223/** 1224 * @param flatbuffers.Long value 1225 * @returns boolean 1226 */ 1227mutate_testhashs64_fnv1a(value:flatbuffers.Long):boolean { 1228 var offset = this.bb!.__offset(this.bb_pos, 48); 1229 1230 if (offset === 0) { 1231 return false; 1232 } 1233 1234 this.bb!.writeInt64(this.bb_pos + offset, value); 1235 return true; 1236}; 1237 1238/** 1239 * @returns flatbuffers.Long 1240 */ 1241testhashu64Fnv1a():flatbuffers.Long { 1242 var offset = this.bb!.__offset(this.bb_pos, 50); 1243 return offset ? this.bb!.readUint64(this.bb_pos + offset) : this.bb!.createLong(0, 0); 1244}; 1245 1246/** 1247 * @param flatbuffers.Long value 1248 * @returns boolean 1249 */ 1250mutate_testhashu64_fnv1a(value:flatbuffers.Long):boolean { 1251 var offset = this.bb!.__offset(this.bb_pos, 50); 1252 1253 if (offset === 0) { 1254 return false; 1255 } 1256 1257 this.bb!.writeUint64(this.bb_pos + offset, value); 1258 return true; 1259}; 1260 1261/** 1262 * @param number index 1263 * @returns boolean 1264 */ 1265testarrayofbools(index: number):boolean|null { 1266 var offset = this.bb!.__offset(this.bb_pos, 52); 1267 return offset ? !!this.bb!.readInt8(this.bb!.__vector(this.bb_pos + offset) + index) : false; 1268}; 1269 1270/** 1271 * @returns number 1272 */ 1273testarrayofboolsLength():number { 1274 var offset = this.bb!.__offset(this.bb_pos, 52); 1275 return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; 1276}; 1277 1278/** 1279 * @returns Int8Array 1280 */ 1281testarrayofboolsArray():Int8Array|null { 1282 var offset = this.bb!.__offset(this.bb_pos, 52); 1283 return offset ? new Int8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null; 1284}; 1285 1286/** 1287 * @returns number 1288 */ 1289testf():number { 1290 var offset = this.bb!.__offset(this.bb_pos, 54); 1291 return offset ? this.bb!.readFloat32(this.bb_pos + offset) : 3.14159; 1292}; 1293 1294/** 1295 * @param number value 1296 * @returns boolean 1297 */ 1298mutate_testf(value:number):boolean { 1299 var offset = this.bb!.__offset(this.bb_pos, 54); 1300 1301 if (offset === 0) { 1302 return false; 1303 } 1304 1305 this.bb!.writeFloat32(this.bb_pos + offset, value); 1306 return true; 1307}; 1308 1309/** 1310 * @returns number 1311 */ 1312testf2():number { 1313 var offset = this.bb!.__offset(this.bb_pos, 56); 1314 return offset ? this.bb!.readFloat32(this.bb_pos + offset) : 3.0; 1315}; 1316 1317/** 1318 * @param number value 1319 * @returns boolean 1320 */ 1321mutate_testf2(value:number):boolean { 1322 var offset = this.bb!.__offset(this.bb_pos, 56); 1323 1324 if (offset === 0) { 1325 return false; 1326 } 1327 1328 this.bb!.writeFloat32(this.bb_pos + offset, value); 1329 return true; 1330}; 1331 1332/** 1333 * @returns number 1334 */ 1335testf3():number { 1336 var offset = this.bb!.__offset(this.bb_pos, 58); 1337 return offset ? this.bb!.readFloat32(this.bb_pos + offset) : 0.0; 1338}; 1339 1340/** 1341 * @param number value 1342 * @returns boolean 1343 */ 1344mutate_testf3(value:number):boolean { 1345 var offset = this.bb!.__offset(this.bb_pos, 58); 1346 1347 if (offset === 0) { 1348 return false; 1349 } 1350 1351 this.bb!.writeFloat32(this.bb_pos + offset, value); 1352 return true; 1353}; 1354 1355/** 1356 * @param number index 1357 * @param flatbuffers.Encoding= optionalEncoding 1358 * @returns string|Uint8Array 1359 */ 1360testarrayofstring2(index: number):string 1361testarrayofstring2(index: number,optionalEncoding:flatbuffers.Encoding):string|Uint8Array 1362testarrayofstring2(index: number,optionalEncoding?:any):string|Uint8Array|null { 1363 var offset = this.bb!.__offset(this.bb_pos, 60); 1364 return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null; 1365}; 1366 1367/** 1368 * @returns number 1369 */ 1370testarrayofstring2Length():number { 1371 var offset = this.bb!.__offset(this.bb_pos, 60); 1372 return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; 1373}; 1374 1375/** 1376 * @param number index 1377 * @param MyGame.Example.Ability= obj 1378 * @returns MyGame.Example.Ability 1379 */ 1380testarrayofsortedstruct(index: number, obj?:MyGame.Example.Ability):MyGame.Example.Ability|null { 1381 var offset = this.bb!.__offset(this.bb_pos, 62); 1382 return offset ? (obj || new MyGame.Example.Ability).__init(this.bb!.__vector(this.bb_pos + offset) + index * 8, this.bb!) : null; 1383}; 1384 1385/** 1386 * @returns number 1387 */ 1388testarrayofsortedstructLength():number { 1389 var offset = this.bb!.__offset(this.bb_pos, 62); 1390 return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; 1391}; 1392 1393/** 1394 * @param number index 1395 * @returns number 1396 */ 1397flex(index: number):number|null { 1398 var offset = this.bb!.__offset(this.bb_pos, 64); 1399 return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0; 1400}; 1401 1402/** 1403 * @returns number 1404 */ 1405flexLength():number { 1406 var offset = this.bb!.__offset(this.bb_pos, 64); 1407 return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; 1408}; 1409 1410/** 1411 * @returns Uint8Array 1412 */ 1413flexArray():Uint8Array|null { 1414 var offset = this.bb!.__offset(this.bb_pos, 64); 1415 return offset ? new Uint8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null; 1416}; 1417 1418/** 1419 * @param number index 1420 * @param MyGame.Example.Test= obj 1421 * @returns MyGame.Example.Test 1422 */ 1423test5(index: number, obj?:MyGame.Example.Test):MyGame.Example.Test|null { 1424 var offset = this.bb!.__offset(this.bb_pos, 66); 1425 return offset ? (obj || new MyGame.Example.Test).__init(this.bb!.__vector(this.bb_pos + offset) + index * 4, this.bb!) : null; 1426}; 1427 1428/** 1429 * @returns number 1430 */ 1431test5Length():number { 1432 var offset = this.bb!.__offset(this.bb_pos, 66); 1433 return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; 1434}; 1435 1436/** 1437 * @param number index 1438 * @returns flatbuffers.Long 1439 */ 1440vectorOfLongs(index: number):flatbuffers.Long|null { 1441 var offset = this.bb!.__offset(this.bb_pos, 68); 1442 return offset ? this.bb!.readInt64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : this.bb!.createLong(0, 0); 1443}; 1444 1445/** 1446 * @returns number 1447 */ 1448vectorOfLongsLength():number { 1449 var offset = this.bb!.__offset(this.bb_pos, 68); 1450 return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; 1451}; 1452 1453/** 1454 * @param number index 1455 * @returns number 1456 */ 1457vectorOfDoubles(index: number):number|null { 1458 var offset = this.bb!.__offset(this.bb_pos, 70); 1459 return offset ? this.bb!.readFloat64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : 0; 1460}; 1461 1462/** 1463 * @returns number 1464 */ 1465vectorOfDoublesLength():number { 1466 var offset = this.bb!.__offset(this.bb_pos, 70); 1467 return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; 1468}; 1469 1470/** 1471 * @returns Float64Array 1472 */ 1473vectorOfDoublesArray():Float64Array|null { 1474 var offset = this.bb!.__offset(this.bb_pos, 70); 1475 return offset ? new Float64Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null; 1476}; 1477 1478/** 1479 * @param MyGame.InParentNamespace= obj 1480 * @returns MyGame.InParentNamespace|null 1481 */ 1482parentNamespaceTest(obj?:MyGame.InParentNamespace):MyGame.InParentNamespace|null { 1483 var offset = this.bb!.__offset(this.bb_pos, 72); 1484 return offset ? (obj || new MyGame.InParentNamespace).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null; 1485}; 1486 1487/** 1488 * @param number index 1489 * @param MyGame.Example.Referrable= obj 1490 * @returns MyGame.Example.Referrable 1491 */ 1492vectorOfReferrables(index: number, obj?:MyGame.Example.Referrable):MyGame.Example.Referrable|null { 1493 var offset = this.bb!.__offset(this.bb_pos, 74); 1494 return offset ? (obj || new MyGame.Example.Referrable).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null; 1495}; 1496 1497/** 1498 * @returns number 1499 */ 1500vectorOfReferrablesLength():number { 1501 var offset = this.bb!.__offset(this.bb_pos, 74); 1502 return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; 1503}; 1504 1505/** 1506 * @returns flatbuffers.Long 1507 */ 1508singleWeakReference():flatbuffers.Long { 1509 var offset = this.bb!.__offset(this.bb_pos, 76); 1510 return offset ? this.bb!.readUint64(this.bb_pos + offset) : this.bb!.createLong(0, 0); 1511}; 1512 1513/** 1514 * @param flatbuffers.Long value 1515 * @returns boolean 1516 */ 1517mutate_single_weak_reference(value:flatbuffers.Long):boolean { 1518 var offset = this.bb!.__offset(this.bb_pos, 76); 1519 1520 if (offset === 0) { 1521 return false; 1522 } 1523 1524 this.bb!.writeUint64(this.bb_pos + offset, value); 1525 return true; 1526}; 1527 1528/** 1529 * @param number index 1530 * @returns flatbuffers.Long 1531 */ 1532vectorOfWeakReferences(index: number):flatbuffers.Long|null { 1533 var offset = this.bb!.__offset(this.bb_pos, 78); 1534 return offset ? this.bb!.readUint64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : this.bb!.createLong(0, 0); 1535}; 1536 1537/** 1538 * @returns number 1539 */ 1540vectorOfWeakReferencesLength():number { 1541 var offset = this.bb!.__offset(this.bb_pos, 78); 1542 return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; 1543}; 1544 1545/** 1546 * @param number index 1547 * @param MyGame.Example.Referrable= obj 1548 * @returns MyGame.Example.Referrable 1549 */ 1550vectorOfStrongReferrables(index: number, obj?:MyGame.Example.Referrable):MyGame.Example.Referrable|null { 1551 var offset = this.bb!.__offset(this.bb_pos, 80); 1552 return offset ? (obj || new MyGame.Example.Referrable).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null; 1553}; 1554 1555/** 1556 * @returns number 1557 */ 1558vectorOfStrongReferrablesLength():number { 1559 var offset = this.bb!.__offset(this.bb_pos, 80); 1560 return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; 1561}; 1562 1563/** 1564 * @returns flatbuffers.Long 1565 */ 1566coOwningReference():flatbuffers.Long { 1567 var offset = this.bb!.__offset(this.bb_pos, 82); 1568 return offset ? this.bb!.readUint64(this.bb_pos + offset) : this.bb!.createLong(0, 0); 1569}; 1570 1571/** 1572 * @param flatbuffers.Long value 1573 * @returns boolean 1574 */ 1575mutate_co_owning_reference(value:flatbuffers.Long):boolean { 1576 var offset = this.bb!.__offset(this.bb_pos, 82); 1577 1578 if (offset === 0) { 1579 return false; 1580 } 1581 1582 this.bb!.writeUint64(this.bb_pos + offset, value); 1583 return true; 1584}; 1585 1586/** 1587 * @param number index 1588 * @returns flatbuffers.Long 1589 */ 1590vectorOfCoOwningReferences(index: number):flatbuffers.Long|null { 1591 var offset = this.bb!.__offset(this.bb_pos, 84); 1592 return offset ? this.bb!.readUint64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : this.bb!.createLong(0, 0); 1593}; 1594 1595/** 1596 * @returns number 1597 */ 1598vectorOfCoOwningReferencesLength():number { 1599 var offset = this.bb!.__offset(this.bb_pos, 84); 1600 return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; 1601}; 1602 1603/** 1604 * @returns flatbuffers.Long 1605 */ 1606nonOwningReference():flatbuffers.Long { 1607 var offset = this.bb!.__offset(this.bb_pos, 86); 1608 return offset ? this.bb!.readUint64(this.bb_pos + offset) : this.bb!.createLong(0, 0); 1609}; 1610 1611/** 1612 * @param flatbuffers.Long value 1613 * @returns boolean 1614 */ 1615mutate_non_owning_reference(value:flatbuffers.Long):boolean { 1616 var offset = this.bb!.__offset(this.bb_pos, 86); 1617 1618 if (offset === 0) { 1619 return false; 1620 } 1621 1622 this.bb!.writeUint64(this.bb_pos + offset, value); 1623 return true; 1624}; 1625 1626/** 1627 * @param number index 1628 * @returns flatbuffers.Long 1629 */ 1630vectorOfNonOwningReferences(index: number):flatbuffers.Long|null { 1631 var offset = this.bb!.__offset(this.bb_pos, 88); 1632 return offset ? this.bb!.readUint64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : this.bb!.createLong(0, 0); 1633}; 1634 1635/** 1636 * @returns number 1637 */ 1638vectorOfNonOwningReferencesLength():number { 1639 var offset = this.bb!.__offset(this.bb_pos, 88); 1640 return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; 1641}; 1642 1643/** 1644 * @returns MyGame.Example.AnyUniqueAliases 1645 */ 1646anyUniqueType():MyGame.Example.AnyUniqueAliases { 1647 var offset = this.bb!.__offset(this.bb_pos, 90); 1648 return offset ? /** */ (this.bb!.readUint8(this.bb_pos + offset)) : MyGame.Example.AnyUniqueAliases.NONE; 1649}; 1650 1651/** 1652 * @param MyGame.Example.AnyUniqueAliases value 1653 * @returns boolean 1654 */ 1655mutate_any_unique_type(value:MyGame.Example.AnyUniqueAliases):boolean { 1656 var offset = this.bb!.__offset(this.bb_pos, 90); 1657 1658 if (offset === 0) { 1659 return false; 1660 } 1661 1662 this.bb!.writeUint8(this.bb_pos + offset, value); 1663 return true; 1664}; 1665 1666/** 1667 * @param flatbuffers.Table obj 1668 * @returns ?flatbuffers.Table 1669 */ 1670anyUnique<T extends flatbuffers.Table>(obj:T):T|null { 1671 var offset = this.bb!.__offset(this.bb_pos, 92); 1672 return offset ? this.bb!.__union(obj, this.bb_pos + offset) : null; 1673}; 1674 1675/** 1676 * @returns MyGame.Example.AnyAmbiguousAliases 1677 */ 1678anyAmbiguousType():MyGame.Example.AnyAmbiguousAliases { 1679 var offset = this.bb!.__offset(this.bb_pos, 94); 1680 return offset ? /** */ (this.bb!.readUint8(this.bb_pos + offset)) : MyGame.Example.AnyAmbiguousAliases.NONE; 1681}; 1682 1683/** 1684 * @param MyGame.Example.AnyAmbiguousAliases value 1685 * @returns boolean 1686 */ 1687mutate_any_ambiguous_type(value:MyGame.Example.AnyAmbiguousAliases):boolean { 1688 var offset = this.bb!.__offset(this.bb_pos, 94); 1689 1690 if (offset === 0) { 1691 return false; 1692 } 1693 1694 this.bb!.writeUint8(this.bb_pos + offset, value); 1695 return true; 1696}; 1697 1698/** 1699 * @param flatbuffers.Table obj 1700 * @returns ?flatbuffers.Table 1701 */ 1702anyAmbiguous<T extends flatbuffers.Table>(obj:T):T|null { 1703 var offset = this.bb!.__offset(this.bb_pos, 96); 1704 return offset ? this.bb!.__union(obj, this.bb_pos + offset) : null; 1705}; 1706 1707/** 1708 * @param number index 1709 * @returns MyGame.Example.Color 1710 */ 1711vectorOfEnums(index: number):MyGame.Example.Color|null { 1712 var offset = this.bb!.__offset(this.bb_pos, 98); 1713 return offset ? /** */ (this.bb!.readInt8(this.bb!.__vector(this.bb_pos + offset) + index)) : /** */ (0); 1714}; 1715 1716/** 1717 * @returns number 1718 */ 1719vectorOfEnumsLength():number { 1720 var offset = this.bb!.__offset(this.bb_pos, 98); 1721 return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; 1722}; 1723 1724/** 1725 * @returns Int8Array 1726 */ 1727vectorOfEnumsArray():Int8Array|null { 1728 var offset = this.bb!.__offset(this.bb_pos, 98); 1729 return offset ? new Int8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null; 1730}; 1731 1732/** 1733 * @param flatbuffers.Builder builder 1734 */ 1735static startMonster(builder:flatbuffers.Builder) { 1736 builder.startObject(48); 1737}; 1738 1739/** 1740 * @param flatbuffers.Builder builder 1741 * @param flatbuffers.Offset posOffset 1742 */ 1743static addPos(builder:flatbuffers.Builder, posOffset:flatbuffers.Offset) { 1744 builder.addFieldStruct(0, posOffset, 0); 1745}; 1746 1747/** 1748 * @param flatbuffers.Builder builder 1749 * @param number mana 1750 */ 1751static addMana(builder:flatbuffers.Builder, mana:number) { 1752 builder.addFieldInt16(1, mana, 150); 1753}; 1754 1755/** 1756 * @param flatbuffers.Builder builder 1757 * @param number hp 1758 */ 1759static addHp(builder:flatbuffers.Builder, hp:number) { 1760 builder.addFieldInt16(2, hp, 100); 1761}; 1762 1763/** 1764 * @param flatbuffers.Builder builder 1765 * @param flatbuffers.Offset nameOffset 1766 */ 1767static addName(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset) { 1768 builder.addFieldOffset(3, nameOffset, 0); 1769}; 1770 1771/** 1772 * @param flatbuffers.Builder builder 1773 * @param flatbuffers.Offset inventoryOffset 1774 */ 1775static addInventory(builder:flatbuffers.Builder, inventoryOffset:flatbuffers.Offset) { 1776 builder.addFieldOffset(5, inventoryOffset, 0); 1777}; 1778 1779/** 1780 * @param flatbuffers.Builder builder 1781 * @param Array.<number> data 1782 * @returns flatbuffers.Offset 1783 */ 1784static createInventoryVector(builder:flatbuffers.Builder, data:number[] | Uint8Array):flatbuffers.Offset { 1785 builder.startVector(1, data.length, 1); 1786 for (var i = data.length - 1; i >= 0; i--) { 1787 builder.addInt8(data[i]); 1788 } 1789 return builder.endVector(); 1790}; 1791 1792/** 1793 * @param flatbuffers.Builder builder 1794 * @param number numElems 1795 */ 1796static startInventoryVector(builder:flatbuffers.Builder, numElems:number) { 1797 builder.startVector(1, numElems, 1); 1798}; 1799 1800/** 1801 * @param flatbuffers.Builder builder 1802 * @param MyGame.Example.Color color 1803 */ 1804static addColor(builder:flatbuffers.Builder, color:MyGame.Example.Color) { 1805 builder.addFieldInt8(6, color, MyGame.Example.Color.Blue); 1806}; 1807 1808/** 1809 * @param flatbuffers.Builder builder 1810 * @param MyGame.Example.Any testType 1811 */ 1812static addTestType(builder:flatbuffers.Builder, testType:MyGame.Example.Any) { 1813 builder.addFieldInt8(7, testType, MyGame.Example.Any.NONE); 1814}; 1815 1816/** 1817 * @param flatbuffers.Builder builder 1818 * @param flatbuffers.Offset testOffset 1819 */ 1820static addTest(builder:flatbuffers.Builder, testOffset:flatbuffers.Offset) { 1821 builder.addFieldOffset(8, testOffset, 0); 1822}; 1823 1824/** 1825 * @param flatbuffers.Builder builder 1826 * @param flatbuffers.Offset test4Offset 1827 */ 1828static addTest4(builder:flatbuffers.Builder, test4Offset:flatbuffers.Offset) { 1829 builder.addFieldOffset(9, test4Offset, 0); 1830}; 1831 1832/** 1833 * @param flatbuffers.Builder builder 1834 * @param number numElems 1835 */ 1836static startTest4Vector(builder:flatbuffers.Builder, numElems:number) { 1837 builder.startVector(4, numElems, 2); 1838}; 1839 1840/** 1841 * @param flatbuffers.Builder builder 1842 * @param flatbuffers.Offset testarrayofstringOffset 1843 */ 1844static addTestarrayofstring(builder:flatbuffers.Builder, testarrayofstringOffset:flatbuffers.Offset) { 1845 builder.addFieldOffset(10, testarrayofstringOffset, 0); 1846}; 1847 1848/** 1849 * @param flatbuffers.Builder builder 1850 * @param Array.<flatbuffers.Offset> data 1851 * @returns flatbuffers.Offset 1852 */ 1853static createTestarrayofstringVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset { 1854 builder.startVector(4, data.length, 4); 1855 for (var i = data.length - 1; i >= 0; i--) { 1856 builder.addOffset(data[i]); 1857 } 1858 return builder.endVector(); 1859}; 1860 1861/** 1862 * @param flatbuffers.Builder builder 1863 * @param number numElems 1864 */ 1865static startTestarrayofstringVector(builder:flatbuffers.Builder, numElems:number) { 1866 builder.startVector(4, numElems, 4); 1867}; 1868 1869/** 1870 * @param flatbuffers.Builder builder 1871 * @param flatbuffers.Offset testarrayoftablesOffset 1872 */ 1873static addTestarrayoftables(builder:flatbuffers.Builder, testarrayoftablesOffset:flatbuffers.Offset) { 1874 builder.addFieldOffset(11, testarrayoftablesOffset, 0); 1875}; 1876 1877/** 1878 * @param flatbuffers.Builder builder 1879 * @param Array.<flatbuffers.Offset> data 1880 * @returns flatbuffers.Offset 1881 */ 1882static createTestarrayoftablesVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset { 1883 builder.startVector(4, data.length, 4); 1884 for (var i = data.length - 1; i >= 0; i--) { 1885 builder.addOffset(data[i]); 1886 } 1887 return builder.endVector(); 1888}; 1889 1890/** 1891 * @param flatbuffers.Builder builder 1892 * @param number numElems 1893 */ 1894static startTestarrayoftablesVector(builder:flatbuffers.Builder, numElems:number) { 1895 builder.startVector(4, numElems, 4); 1896}; 1897 1898/** 1899 * @param flatbuffers.Builder builder 1900 * @param flatbuffers.Offset enemyOffset 1901 */ 1902static addEnemy(builder:flatbuffers.Builder, enemyOffset:flatbuffers.Offset) { 1903 builder.addFieldOffset(12, enemyOffset, 0); 1904}; 1905 1906/** 1907 * @param flatbuffers.Builder builder 1908 * @param flatbuffers.Offset testnestedflatbufferOffset 1909 */ 1910static addTestnestedflatbuffer(builder:flatbuffers.Builder, testnestedflatbufferOffset:flatbuffers.Offset) { 1911 builder.addFieldOffset(13, testnestedflatbufferOffset, 0); 1912}; 1913 1914/** 1915 * @param flatbuffers.Builder builder 1916 * @param Array.<number> data 1917 * @returns flatbuffers.Offset 1918 */ 1919static createTestnestedflatbufferVector(builder:flatbuffers.Builder, data:number[] | Uint8Array):flatbuffers.Offset { 1920 builder.startVector(1, data.length, 1); 1921 for (var i = data.length - 1; i >= 0; i--) { 1922 builder.addInt8(data[i]); 1923 } 1924 return builder.endVector(); 1925}; 1926 1927/** 1928 * @param flatbuffers.Builder builder 1929 * @param number numElems 1930 */ 1931static startTestnestedflatbufferVector(builder:flatbuffers.Builder, numElems:number) { 1932 builder.startVector(1, numElems, 1); 1933}; 1934 1935/** 1936 * @param flatbuffers.Builder builder 1937 * @param flatbuffers.Offset testemptyOffset 1938 */ 1939static addTestempty(builder:flatbuffers.Builder, testemptyOffset:flatbuffers.Offset) { 1940 builder.addFieldOffset(14, testemptyOffset, 0); 1941}; 1942 1943/** 1944 * @param flatbuffers.Builder builder 1945 * @param boolean testbool 1946 */ 1947static addTestbool(builder:flatbuffers.Builder, testbool:boolean) { 1948 builder.addFieldInt8(15, +testbool, +false); 1949}; 1950 1951/** 1952 * @param flatbuffers.Builder builder 1953 * @param number testhashs32Fnv1 1954 */ 1955static addTesthashs32Fnv1(builder:flatbuffers.Builder, testhashs32Fnv1:number) { 1956 builder.addFieldInt32(16, testhashs32Fnv1, 0); 1957}; 1958 1959/** 1960 * @param flatbuffers.Builder builder 1961 * @param number testhashu32Fnv1 1962 */ 1963static addTesthashu32Fnv1(builder:flatbuffers.Builder, testhashu32Fnv1:number) { 1964 builder.addFieldInt32(17, testhashu32Fnv1, 0); 1965}; 1966 1967/** 1968 * @param flatbuffers.Builder builder 1969 * @param flatbuffers.Long testhashs64Fnv1 1970 */ 1971static addTesthashs64Fnv1(builder:flatbuffers.Builder, testhashs64Fnv1:flatbuffers.Long) { 1972 builder.addFieldInt64(18, testhashs64Fnv1, builder.createLong(0, 0)); 1973}; 1974 1975/** 1976 * @param flatbuffers.Builder builder 1977 * @param flatbuffers.Long testhashu64Fnv1 1978 */ 1979static addTesthashu64Fnv1(builder:flatbuffers.Builder, testhashu64Fnv1:flatbuffers.Long) { 1980 builder.addFieldInt64(19, testhashu64Fnv1, builder.createLong(0, 0)); 1981}; 1982 1983/** 1984 * @param flatbuffers.Builder builder 1985 * @param number testhashs32Fnv1a 1986 */ 1987static addTesthashs32Fnv1a(builder:flatbuffers.Builder, testhashs32Fnv1a:number) { 1988 builder.addFieldInt32(20, testhashs32Fnv1a, 0); 1989}; 1990 1991/** 1992 * @param flatbuffers.Builder builder 1993 * @param number testhashu32Fnv1a 1994 */ 1995static addTesthashu32Fnv1a(builder:flatbuffers.Builder, testhashu32Fnv1a:number) { 1996 builder.addFieldInt32(21, testhashu32Fnv1a, 0); 1997}; 1998 1999/** 2000 * @param flatbuffers.Builder builder 2001 * @param flatbuffers.Long testhashs64Fnv1a 2002 */ 2003static addTesthashs64Fnv1a(builder:flatbuffers.Builder, testhashs64Fnv1a:flatbuffers.Long) { 2004 builder.addFieldInt64(22, testhashs64Fnv1a, builder.createLong(0, 0)); 2005}; 2006 2007/** 2008 * @param flatbuffers.Builder builder 2009 * @param flatbuffers.Long testhashu64Fnv1a 2010 */ 2011static addTesthashu64Fnv1a(builder:flatbuffers.Builder, testhashu64Fnv1a:flatbuffers.Long) { 2012 builder.addFieldInt64(23, testhashu64Fnv1a, builder.createLong(0, 0)); 2013}; 2014 2015/** 2016 * @param flatbuffers.Builder builder 2017 * @param flatbuffers.Offset testarrayofboolsOffset 2018 */ 2019static addTestarrayofbools(builder:flatbuffers.Builder, testarrayofboolsOffset:flatbuffers.Offset) { 2020 builder.addFieldOffset(24, testarrayofboolsOffset, 0); 2021}; 2022 2023/** 2024 * @param flatbuffers.Builder builder 2025 * @param Array.<boolean> data 2026 * @returns flatbuffers.Offset 2027 */ 2028static createTestarrayofboolsVector(builder:flatbuffers.Builder, data:boolean[]):flatbuffers.Offset { 2029 builder.startVector(1, data.length, 1); 2030 for (var i = data.length - 1; i >= 0; i--) { 2031 builder.addInt8(+data[i]); 2032 } 2033 return builder.endVector(); 2034}; 2035 2036/** 2037 * @param flatbuffers.Builder builder 2038 * @param number numElems 2039 */ 2040static startTestarrayofboolsVector(builder:flatbuffers.Builder, numElems:number) { 2041 builder.startVector(1, numElems, 1); 2042}; 2043 2044/** 2045 * @param flatbuffers.Builder builder 2046 * @param number testf 2047 */ 2048static addTestf(builder:flatbuffers.Builder, testf:number) { 2049 builder.addFieldFloat32(25, testf, 3.14159); 2050}; 2051 2052/** 2053 * @param flatbuffers.Builder builder 2054 * @param number testf2 2055 */ 2056static addTestf2(builder:flatbuffers.Builder, testf2:number) { 2057 builder.addFieldFloat32(26, testf2, 3.0); 2058}; 2059 2060/** 2061 * @param flatbuffers.Builder builder 2062 * @param number testf3 2063 */ 2064static addTestf3(builder:flatbuffers.Builder, testf3:number) { 2065 builder.addFieldFloat32(27, testf3, 0.0); 2066}; 2067 2068/** 2069 * @param flatbuffers.Builder builder 2070 * @param flatbuffers.Offset testarrayofstring2Offset 2071 */ 2072static addTestarrayofstring2(builder:flatbuffers.Builder, testarrayofstring2Offset:flatbuffers.Offset) { 2073 builder.addFieldOffset(28, testarrayofstring2Offset, 0); 2074}; 2075 2076/** 2077 * @param flatbuffers.Builder builder 2078 * @param Array.<flatbuffers.Offset> data 2079 * @returns flatbuffers.Offset 2080 */ 2081static createTestarrayofstring2Vector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset { 2082 builder.startVector(4, data.length, 4); 2083 for (var i = data.length - 1; i >= 0; i--) { 2084 builder.addOffset(data[i]); 2085 } 2086 return builder.endVector(); 2087}; 2088 2089/** 2090 * @param flatbuffers.Builder builder 2091 * @param number numElems 2092 */ 2093static startTestarrayofstring2Vector(builder:flatbuffers.Builder, numElems:number) { 2094 builder.startVector(4, numElems, 4); 2095}; 2096 2097/** 2098 * @param flatbuffers.Builder builder 2099 * @param flatbuffers.Offset testarrayofsortedstructOffset 2100 */ 2101static addTestarrayofsortedstruct(builder:flatbuffers.Builder, testarrayofsortedstructOffset:flatbuffers.Offset) { 2102 builder.addFieldOffset(29, testarrayofsortedstructOffset, 0); 2103}; 2104 2105/** 2106 * @param flatbuffers.Builder builder 2107 * @param number numElems 2108 */ 2109static startTestarrayofsortedstructVector(builder:flatbuffers.Builder, numElems:number) { 2110 builder.startVector(8, numElems, 4); 2111}; 2112 2113/** 2114 * @param flatbuffers.Builder builder 2115 * @param flatbuffers.Offset flexOffset 2116 */ 2117static addFlex(builder:flatbuffers.Builder, flexOffset:flatbuffers.Offset) { 2118 builder.addFieldOffset(30, flexOffset, 0); 2119}; 2120 2121/** 2122 * @param flatbuffers.Builder builder 2123 * @param Array.<number> data 2124 * @returns flatbuffers.Offset 2125 */ 2126static createFlexVector(builder:flatbuffers.Builder, data:number[] | Uint8Array):flatbuffers.Offset { 2127 builder.startVector(1, data.length, 1); 2128 for (var i = data.length - 1; i >= 0; i--) { 2129 builder.addInt8(data[i]); 2130 } 2131 return builder.endVector(); 2132}; 2133 2134/** 2135 * @param flatbuffers.Builder builder 2136 * @param number numElems 2137 */ 2138static startFlexVector(builder:flatbuffers.Builder, numElems:number) { 2139 builder.startVector(1, numElems, 1); 2140}; 2141 2142/** 2143 * @param flatbuffers.Builder builder 2144 * @param flatbuffers.Offset test5Offset 2145 */ 2146static addTest5(builder:flatbuffers.Builder, test5Offset:flatbuffers.Offset) { 2147 builder.addFieldOffset(31, test5Offset, 0); 2148}; 2149 2150/** 2151 * @param flatbuffers.Builder builder 2152 * @param number numElems 2153 */ 2154static startTest5Vector(builder:flatbuffers.Builder, numElems:number) { 2155 builder.startVector(4, numElems, 2); 2156}; 2157 2158/** 2159 * @param flatbuffers.Builder builder 2160 * @param flatbuffers.Offset vectorOfLongsOffset 2161 */ 2162static addVectorOfLongs(builder:flatbuffers.Builder, vectorOfLongsOffset:flatbuffers.Offset) { 2163 builder.addFieldOffset(32, vectorOfLongsOffset, 0); 2164}; 2165 2166/** 2167 * @param flatbuffers.Builder builder 2168 * @param Array.<flatbuffers.Long> data 2169 * @returns flatbuffers.Offset 2170 */ 2171static createVectorOfLongsVector(builder:flatbuffers.Builder, data:flatbuffers.Long[]):flatbuffers.Offset { 2172 builder.startVector(8, data.length, 8); 2173 for (var i = data.length - 1; i >= 0; i--) { 2174 builder.addInt64(data[i]); 2175 } 2176 return builder.endVector(); 2177}; 2178 2179/** 2180 * @param flatbuffers.Builder builder 2181 * @param number numElems 2182 */ 2183static startVectorOfLongsVector(builder:flatbuffers.Builder, numElems:number) { 2184 builder.startVector(8, numElems, 8); 2185}; 2186 2187/** 2188 * @param flatbuffers.Builder builder 2189 * @param flatbuffers.Offset vectorOfDoublesOffset 2190 */ 2191static addVectorOfDoubles(builder:flatbuffers.Builder, vectorOfDoublesOffset:flatbuffers.Offset) { 2192 builder.addFieldOffset(33, vectorOfDoublesOffset, 0); 2193}; 2194 2195/** 2196 * @param flatbuffers.Builder builder 2197 * @param Array.<number> data 2198 * @returns flatbuffers.Offset 2199 */ 2200static createVectorOfDoublesVector(builder:flatbuffers.Builder, data:number[] | Uint8Array):flatbuffers.Offset { 2201 builder.startVector(8, data.length, 8); 2202 for (var i = data.length - 1; i >= 0; i--) { 2203 builder.addFloat64(data[i]); 2204 } 2205 return builder.endVector(); 2206}; 2207 2208/** 2209 * @param flatbuffers.Builder builder 2210 * @param number numElems 2211 */ 2212static startVectorOfDoublesVector(builder:flatbuffers.Builder, numElems:number) { 2213 builder.startVector(8, numElems, 8); 2214}; 2215 2216/** 2217 * @param flatbuffers.Builder builder 2218 * @param flatbuffers.Offset parentNamespaceTestOffset 2219 */ 2220static addParentNamespaceTest(builder:flatbuffers.Builder, parentNamespaceTestOffset:flatbuffers.Offset) { 2221 builder.addFieldOffset(34, parentNamespaceTestOffset, 0); 2222}; 2223 2224/** 2225 * @param flatbuffers.Builder builder 2226 * @param flatbuffers.Offset vectorOfReferrablesOffset 2227 */ 2228static addVectorOfReferrables(builder:flatbuffers.Builder, vectorOfReferrablesOffset:flatbuffers.Offset) { 2229 builder.addFieldOffset(35, vectorOfReferrablesOffset, 0); 2230}; 2231 2232/** 2233 * @param flatbuffers.Builder builder 2234 * @param Array.<flatbuffers.Offset> data 2235 * @returns flatbuffers.Offset 2236 */ 2237static createVectorOfReferrablesVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset { 2238 builder.startVector(4, data.length, 4); 2239 for (var i = data.length - 1; i >= 0; i--) { 2240 builder.addOffset(data[i]); 2241 } 2242 return builder.endVector(); 2243}; 2244 2245/** 2246 * @param flatbuffers.Builder builder 2247 * @param number numElems 2248 */ 2249static startVectorOfReferrablesVector(builder:flatbuffers.Builder, numElems:number) { 2250 builder.startVector(4, numElems, 4); 2251}; 2252 2253/** 2254 * @param flatbuffers.Builder builder 2255 * @param flatbuffers.Long singleWeakReference 2256 */ 2257static addSingleWeakReference(builder:flatbuffers.Builder, singleWeakReference:flatbuffers.Long) { 2258 builder.addFieldInt64(36, singleWeakReference, builder.createLong(0, 0)); 2259}; 2260 2261/** 2262 * @param flatbuffers.Builder builder 2263 * @param flatbuffers.Offset vectorOfWeakReferencesOffset 2264 */ 2265static addVectorOfWeakReferences(builder:flatbuffers.Builder, vectorOfWeakReferencesOffset:flatbuffers.Offset) { 2266 builder.addFieldOffset(37, vectorOfWeakReferencesOffset, 0); 2267}; 2268 2269/** 2270 * @param flatbuffers.Builder builder 2271 * @param Array.<flatbuffers.Long> data 2272 * @returns flatbuffers.Offset 2273 */ 2274static createVectorOfWeakReferencesVector(builder:flatbuffers.Builder, data:flatbuffers.Long[]):flatbuffers.Offset { 2275 builder.startVector(8, data.length, 8); 2276 for (var i = data.length - 1; i >= 0; i--) { 2277 builder.addInt64(data[i]); 2278 } 2279 return builder.endVector(); 2280}; 2281 2282/** 2283 * @param flatbuffers.Builder builder 2284 * @param number numElems 2285 */ 2286static startVectorOfWeakReferencesVector(builder:flatbuffers.Builder, numElems:number) { 2287 builder.startVector(8, numElems, 8); 2288}; 2289 2290/** 2291 * @param flatbuffers.Builder builder 2292 * @param flatbuffers.Offset vectorOfStrongReferrablesOffset 2293 */ 2294static addVectorOfStrongReferrables(builder:flatbuffers.Builder, vectorOfStrongReferrablesOffset:flatbuffers.Offset) { 2295 builder.addFieldOffset(38, vectorOfStrongReferrablesOffset, 0); 2296}; 2297 2298/** 2299 * @param flatbuffers.Builder builder 2300 * @param Array.<flatbuffers.Offset> data 2301 * @returns flatbuffers.Offset 2302 */ 2303static createVectorOfStrongReferrablesVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset { 2304 builder.startVector(4, data.length, 4); 2305 for (var i = data.length - 1; i >= 0; i--) { 2306 builder.addOffset(data[i]); 2307 } 2308 return builder.endVector(); 2309}; 2310 2311/** 2312 * @param flatbuffers.Builder builder 2313 * @param number numElems 2314 */ 2315static startVectorOfStrongReferrablesVector(builder:flatbuffers.Builder, numElems:number) { 2316 builder.startVector(4, numElems, 4); 2317}; 2318 2319/** 2320 * @param flatbuffers.Builder builder 2321 * @param flatbuffers.Long coOwningReference 2322 */ 2323static addCoOwningReference(builder:flatbuffers.Builder, coOwningReference:flatbuffers.Long) { 2324 builder.addFieldInt64(39, coOwningReference, builder.createLong(0, 0)); 2325}; 2326 2327/** 2328 * @param flatbuffers.Builder builder 2329 * @param flatbuffers.Offset vectorOfCoOwningReferencesOffset 2330 */ 2331static addVectorOfCoOwningReferences(builder:flatbuffers.Builder, vectorOfCoOwningReferencesOffset:flatbuffers.Offset) { 2332 builder.addFieldOffset(40, vectorOfCoOwningReferencesOffset, 0); 2333}; 2334 2335/** 2336 * @param flatbuffers.Builder builder 2337 * @param Array.<flatbuffers.Long> data 2338 * @returns flatbuffers.Offset 2339 */ 2340static createVectorOfCoOwningReferencesVector(builder:flatbuffers.Builder, data:flatbuffers.Long[]):flatbuffers.Offset { 2341 builder.startVector(8, data.length, 8); 2342 for (var i = data.length - 1; i >= 0; i--) { 2343 builder.addInt64(data[i]); 2344 } 2345 return builder.endVector(); 2346}; 2347 2348/** 2349 * @param flatbuffers.Builder builder 2350 * @param number numElems 2351 */ 2352static startVectorOfCoOwningReferencesVector(builder:flatbuffers.Builder, numElems:number) { 2353 builder.startVector(8, numElems, 8); 2354}; 2355 2356/** 2357 * @param flatbuffers.Builder builder 2358 * @param flatbuffers.Long nonOwningReference 2359 */ 2360static addNonOwningReference(builder:flatbuffers.Builder, nonOwningReference:flatbuffers.Long) { 2361 builder.addFieldInt64(41, nonOwningReference, builder.createLong(0, 0)); 2362}; 2363 2364/** 2365 * @param flatbuffers.Builder builder 2366 * @param flatbuffers.Offset vectorOfNonOwningReferencesOffset 2367 */ 2368static addVectorOfNonOwningReferences(builder:flatbuffers.Builder, vectorOfNonOwningReferencesOffset:flatbuffers.Offset) { 2369 builder.addFieldOffset(42, vectorOfNonOwningReferencesOffset, 0); 2370}; 2371 2372/** 2373 * @param flatbuffers.Builder builder 2374 * @param Array.<flatbuffers.Long> data 2375 * @returns flatbuffers.Offset 2376 */ 2377static createVectorOfNonOwningReferencesVector(builder:flatbuffers.Builder, data:flatbuffers.Long[]):flatbuffers.Offset { 2378 builder.startVector(8, data.length, 8); 2379 for (var i = data.length - 1; i >= 0; i--) { 2380 builder.addInt64(data[i]); 2381 } 2382 return builder.endVector(); 2383}; 2384 2385/** 2386 * @param flatbuffers.Builder builder 2387 * @param number numElems 2388 */ 2389static startVectorOfNonOwningReferencesVector(builder:flatbuffers.Builder, numElems:number) { 2390 builder.startVector(8, numElems, 8); 2391}; 2392 2393/** 2394 * @param flatbuffers.Builder builder 2395 * @param MyGame.Example.AnyUniqueAliases anyUniqueType 2396 */ 2397static addAnyUniqueType(builder:flatbuffers.Builder, anyUniqueType:MyGame.Example.AnyUniqueAliases) { 2398 builder.addFieldInt8(43, anyUniqueType, MyGame.Example.AnyUniqueAliases.NONE); 2399}; 2400 2401/** 2402 * @param flatbuffers.Builder builder 2403 * @param flatbuffers.Offset anyUniqueOffset 2404 */ 2405static addAnyUnique(builder:flatbuffers.Builder, anyUniqueOffset:flatbuffers.Offset) { 2406 builder.addFieldOffset(44, anyUniqueOffset, 0); 2407}; 2408 2409/** 2410 * @param flatbuffers.Builder builder 2411 * @param MyGame.Example.AnyAmbiguousAliases anyAmbiguousType 2412 */ 2413static addAnyAmbiguousType(builder:flatbuffers.Builder, anyAmbiguousType:MyGame.Example.AnyAmbiguousAliases) { 2414 builder.addFieldInt8(45, anyAmbiguousType, MyGame.Example.AnyAmbiguousAliases.NONE); 2415}; 2416 2417/** 2418 * @param flatbuffers.Builder builder 2419 * @param flatbuffers.Offset anyAmbiguousOffset 2420 */ 2421static addAnyAmbiguous(builder:flatbuffers.Builder, anyAmbiguousOffset:flatbuffers.Offset) { 2422 builder.addFieldOffset(46, anyAmbiguousOffset, 0); 2423}; 2424 2425/** 2426 * @param flatbuffers.Builder builder 2427 * @param flatbuffers.Offset vectorOfEnumsOffset 2428 */ 2429static addVectorOfEnums(builder:flatbuffers.Builder, vectorOfEnumsOffset:flatbuffers.Offset) { 2430 builder.addFieldOffset(47, vectorOfEnumsOffset, 0); 2431}; 2432 2433/** 2434 * @param flatbuffers.Builder builder 2435 * @param Array.<MyGame.Example.Color> data 2436 * @returns flatbuffers.Offset 2437 */ 2438static createVectorOfEnumsVector(builder:flatbuffers.Builder, data:MyGame.Example.Color[]):flatbuffers.Offset { 2439 builder.startVector(1, data.length, 1); 2440 for (var i = data.length - 1; i >= 0; i--) { 2441 builder.addInt8(data[i]); 2442 } 2443 return builder.endVector(); 2444}; 2445 2446/** 2447 * @param flatbuffers.Builder builder 2448 * @param number numElems 2449 */ 2450static startVectorOfEnumsVector(builder:flatbuffers.Builder, numElems:number) { 2451 builder.startVector(1, numElems, 1); 2452}; 2453 2454/** 2455 * @param flatbuffers.Builder builder 2456 * @returns flatbuffers.Offset 2457 */ 2458static endMonster(builder:flatbuffers.Builder):flatbuffers.Offset { 2459 var offset = builder.endObject(); 2460 builder.requiredField(offset, 10); // name 2461 return offset; 2462}; 2463 2464/** 2465 * @param flatbuffers.Builder builder 2466 * @param flatbuffers.Offset offset 2467 */ 2468static finishMonsterBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) { 2469 builder.finish(offset, 'MONS'); 2470}; 2471 2472static createMonster(builder:flatbuffers.Builder, posOffset:flatbuffers.Offset, mana:number, hp:number, nameOffset:flatbuffers.Offset, inventoryOffset:flatbuffers.Offset, color:MyGame.Example.Color, testType:MyGame.Example.Any, testOffset:flatbuffers.Offset, test4Offset:flatbuffers.Offset, testarrayofstringOffset:flatbuffers.Offset, testarrayoftablesOffset:flatbuffers.Offset, enemyOffset:flatbuffers.Offset, testnestedflatbufferOffset:flatbuffers.Offset, testemptyOffset:flatbuffers.Offset, testbool:boolean, testhashs32Fnv1:number, testhashu32Fnv1:number, testhashs64Fnv1:flatbuffers.Long, testhashu64Fnv1:flatbuffers.Long, testhashs32Fnv1a:number, testhashu32Fnv1a:number, testhashs64Fnv1a:flatbuffers.Long, testhashu64Fnv1a:flatbuffers.Long, testarrayofboolsOffset:flatbuffers.Offset, testf:number, testf2:number, testf3:number, testarrayofstring2Offset:flatbuffers.Offset, testarrayofsortedstructOffset:flatbuffers.Offset, flexOffset:flatbuffers.Offset, test5Offset:flatbuffers.Offset, vectorOfLongsOffset:flatbuffers.Offset, vectorOfDoublesOffset:flatbuffers.Offset, parentNamespaceTestOffset:flatbuffers.Offset, vectorOfReferrablesOffset:flatbuffers.Offset, singleWeakReference:flatbuffers.Long, vectorOfWeakReferencesOffset:flatbuffers.Offset, vectorOfStrongReferrablesOffset:flatbuffers.Offset, coOwningReference:flatbuffers.Long, vectorOfCoOwningReferencesOffset:flatbuffers.Offset, nonOwningReference:flatbuffers.Long, vectorOfNonOwningReferencesOffset:flatbuffers.Offset, anyUniqueType:MyGame.Example.AnyUniqueAliases, anyUniqueOffset:flatbuffers.Offset, anyAmbiguousType:MyGame.Example.AnyAmbiguousAliases, anyAmbiguousOffset:flatbuffers.Offset, vectorOfEnumsOffset:flatbuffers.Offset):flatbuffers.Offset { 2473 Monster.startMonster(builder); 2474 Monster.addPos(builder, posOffset); 2475 Monster.addMana(builder, mana); 2476 Monster.addHp(builder, hp); 2477 Monster.addName(builder, nameOffset); 2478 Monster.addInventory(builder, inventoryOffset); 2479 Monster.addColor(builder, color); 2480 Monster.addTestType(builder, testType); 2481 Monster.addTest(builder, testOffset); 2482 Monster.addTest4(builder, test4Offset); 2483 Monster.addTestarrayofstring(builder, testarrayofstringOffset); 2484 Monster.addTestarrayoftables(builder, testarrayoftablesOffset); 2485 Monster.addEnemy(builder, enemyOffset); 2486 Monster.addTestnestedflatbuffer(builder, testnestedflatbufferOffset); 2487 Monster.addTestempty(builder, testemptyOffset); 2488 Monster.addTestbool(builder, testbool); 2489 Monster.addTesthashs32Fnv1(builder, testhashs32Fnv1); 2490 Monster.addTesthashu32Fnv1(builder, testhashu32Fnv1); 2491 Monster.addTesthashs64Fnv1(builder, testhashs64Fnv1); 2492 Monster.addTesthashu64Fnv1(builder, testhashu64Fnv1); 2493 Monster.addTesthashs32Fnv1a(builder, testhashs32Fnv1a); 2494 Monster.addTesthashu32Fnv1a(builder, testhashu32Fnv1a); 2495 Monster.addTesthashs64Fnv1a(builder, testhashs64Fnv1a); 2496 Monster.addTesthashu64Fnv1a(builder, testhashu64Fnv1a); 2497 Monster.addTestarrayofbools(builder, testarrayofboolsOffset); 2498 Monster.addTestf(builder, testf); 2499 Monster.addTestf2(builder, testf2); 2500 Monster.addTestf3(builder, testf3); 2501 Monster.addTestarrayofstring2(builder, testarrayofstring2Offset); 2502 Monster.addTestarrayofsortedstruct(builder, testarrayofsortedstructOffset); 2503 Monster.addFlex(builder, flexOffset); 2504 Monster.addTest5(builder, test5Offset); 2505 Monster.addVectorOfLongs(builder, vectorOfLongsOffset); 2506 Monster.addVectorOfDoubles(builder, vectorOfDoublesOffset); 2507 Monster.addParentNamespaceTest(builder, parentNamespaceTestOffset); 2508 Monster.addVectorOfReferrables(builder, vectorOfReferrablesOffset); 2509 Monster.addSingleWeakReference(builder, singleWeakReference); 2510 Monster.addVectorOfWeakReferences(builder, vectorOfWeakReferencesOffset); 2511 Monster.addVectorOfStrongReferrables(builder, vectorOfStrongReferrablesOffset); 2512 Monster.addCoOwningReference(builder, coOwningReference); 2513 Monster.addVectorOfCoOwningReferences(builder, vectorOfCoOwningReferencesOffset); 2514 Monster.addNonOwningReference(builder, nonOwningReference); 2515 Monster.addVectorOfNonOwningReferences(builder, vectorOfNonOwningReferencesOffset); 2516 Monster.addAnyUniqueType(builder, anyUniqueType); 2517 Monster.addAnyUnique(builder, anyUniqueOffset); 2518 Monster.addAnyAmbiguousType(builder, anyAmbiguousType); 2519 Monster.addAnyAmbiguous(builder, anyAmbiguousOffset); 2520 Monster.addVectorOfEnums(builder, vectorOfEnumsOffset); 2521 return Monster.endMonster(builder); 2522} 2523} 2524} 2525/** 2526 * @constructor 2527 */ 2528export namespace MyGame.Example{ 2529export class TypeAliases { 2530 bb: flatbuffers.ByteBuffer|null = null; 2531 2532 bb_pos:number = 0; 2533/** 2534 * @param number i 2535 * @param flatbuffers.ByteBuffer bb 2536 * @returns TypeAliases 2537 */ 2538__init(i:number, bb:flatbuffers.ByteBuffer):TypeAliases { 2539 this.bb_pos = i; 2540 this.bb = bb; 2541 return this; 2542}; 2543 2544/** 2545 * @param flatbuffers.ByteBuffer bb 2546 * @param TypeAliases= obj 2547 * @returns TypeAliases 2548 */ 2549static getRootAsTypeAliases(bb:flatbuffers.ByteBuffer, obj?:TypeAliases):TypeAliases { 2550 return (obj || new TypeAliases).__init(bb.readInt32(bb.position()) + bb.position(), bb); 2551}; 2552 2553/** 2554 * @returns number 2555 */ 2556i8():number { 2557 var offset = this.bb!.__offset(this.bb_pos, 4); 2558 return offset ? this.bb!.readInt8(this.bb_pos + offset) : 0; 2559}; 2560 2561/** 2562 * @param number value 2563 * @returns boolean 2564 */ 2565mutate_i8(value:number):boolean { 2566 var offset = this.bb!.__offset(this.bb_pos, 4); 2567 2568 if (offset === 0) { 2569 return false; 2570 } 2571 2572 this.bb!.writeInt8(this.bb_pos + offset, value); 2573 return true; 2574}; 2575 2576/** 2577 * @returns number 2578 */ 2579u8():number { 2580 var offset = this.bb!.__offset(this.bb_pos, 6); 2581 return offset ? this.bb!.readUint8(this.bb_pos + offset) : 0; 2582}; 2583 2584/** 2585 * @param number value 2586 * @returns boolean 2587 */ 2588mutate_u8(value:number):boolean { 2589 var offset = this.bb!.__offset(this.bb_pos, 6); 2590 2591 if (offset === 0) { 2592 return false; 2593 } 2594 2595 this.bb!.writeUint8(this.bb_pos + offset, value); 2596 return true; 2597}; 2598 2599/** 2600 * @returns number 2601 */ 2602i16():number { 2603 var offset = this.bb!.__offset(this.bb_pos, 8); 2604 return offset ? this.bb!.readInt16(this.bb_pos + offset) : 0; 2605}; 2606 2607/** 2608 * @param number value 2609 * @returns boolean 2610 */ 2611mutate_i16(value:number):boolean { 2612 var offset = this.bb!.__offset(this.bb_pos, 8); 2613 2614 if (offset === 0) { 2615 return false; 2616 } 2617 2618 this.bb!.writeInt16(this.bb_pos + offset, value); 2619 return true; 2620}; 2621 2622/** 2623 * @returns number 2624 */ 2625u16():number { 2626 var offset = this.bb!.__offset(this.bb_pos, 10); 2627 return offset ? this.bb!.readUint16(this.bb_pos + offset) : 0; 2628}; 2629 2630/** 2631 * @param number value 2632 * @returns boolean 2633 */ 2634mutate_u16(value:number):boolean { 2635 var offset = this.bb!.__offset(this.bb_pos, 10); 2636 2637 if (offset === 0) { 2638 return false; 2639 } 2640 2641 this.bb!.writeUint16(this.bb_pos + offset, value); 2642 return true; 2643}; 2644 2645/** 2646 * @returns number 2647 */ 2648i32():number { 2649 var offset = this.bb!.__offset(this.bb_pos, 12); 2650 return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0; 2651}; 2652 2653/** 2654 * @param number value 2655 * @returns boolean 2656 */ 2657mutate_i32(value:number):boolean { 2658 var offset = this.bb!.__offset(this.bb_pos, 12); 2659 2660 if (offset === 0) { 2661 return false; 2662 } 2663 2664 this.bb!.writeInt32(this.bb_pos + offset, value); 2665 return true; 2666}; 2667 2668/** 2669 * @returns number 2670 */ 2671u32():number { 2672 var offset = this.bb!.__offset(this.bb_pos, 14); 2673 return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0; 2674}; 2675 2676/** 2677 * @param number value 2678 * @returns boolean 2679 */ 2680mutate_u32(value:number):boolean { 2681 var offset = this.bb!.__offset(this.bb_pos, 14); 2682 2683 if (offset === 0) { 2684 return false; 2685 } 2686 2687 this.bb!.writeUint32(this.bb_pos + offset, value); 2688 return true; 2689}; 2690 2691/** 2692 * @returns flatbuffers.Long 2693 */ 2694i64():flatbuffers.Long { 2695 var offset = this.bb!.__offset(this.bb_pos, 16); 2696 return offset ? this.bb!.readInt64(this.bb_pos + offset) : this.bb!.createLong(0, 0); 2697}; 2698 2699/** 2700 * @param flatbuffers.Long value 2701 * @returns boolean 2702 */ 2703mutate_i64(value:flatbuffers.Long):boolean { 2704 var offset = this.bb!.__offset(this.bb_pos, 16); 2705 2706 if (offset === 0) { 2707 return false; 2708 } 2709 2710 this.bb!.writeInt64(this.bb_pos + offset, value); 2711 return true; 2712}; 2713 2714/** 2715 * @returns flatbuffers.Long 2716 */ 2717u64():flatbuffers.Long { 2718 var offset = this.bb!.__offset(this.bb_pos, 18); 2719 return offset ? this.bb!.readUint64(this.bb_pos + offset) : this.bb!.createLong(0, 0); 2720}; 2721 2722/** 2723 * @param flatbuffers.Long value 2724 * @returns boolean 2725 */ 2726mutate_u64(value:flatbuffers.Long):boolean { 2727 var offset = this.bb!.__offset(this.bb_pos, 18); 2728 2729 if (offset === 0) { 2730 return false; 2731 } 2732 2733 this.bb!.writeUint64(this.bb_pos + offset, value); 2734 return true; 2735}; 2736 2737/** 2738 * @returns number 2739 */ 2740f32():number { 2741 var offset = this.bb!.__offset(this.bb_pos, 20); 2742 return offset ? this.bb!.readFloat32(this.bb_pos + offset) : 0.0; 2743}; 2744 2745/** 2746 * @param number value 2747 * @returns boolean 2748 */ 2749mutate_f32(value:number):boolean { 2750 var offset = this.bb!.__offset(this.bb_pos, 20); 2751 2752 if (offset === 0) { 2753 return false; 2754 } 2755 2756 this.bb!.writeFloat32(this.bb_pos + offset, value); 2757 return true; 2758}; 2759 2760/** 2761 * @returns number 2762 */ 2763f64():number { 2764 var offset = this.bb!.__offset(this.bb_pos, 22); 2765 return offset ? this.bb!.readFloat64(this.bb_pos + offset) : 0.0; 2766}; 2767 2768/** 2769 * @param number value 2770 * @returns boolean 2771 */ 2772mutate_f64(value:number):boolean { 2773 var offset = this.bb!.__offset(this.bb_pos, 22); 2774 2775 if (offset === 0) { 2776 return false; 2777 } 2778 2779 this.bb!.writeFloat64(this.bb_pos + offset, value); 2780 return true; 2781}; 2782 2783/** 2784 * @param number index 2785 * @returns number 2786 */ 2787v8(index: number):number|null { 2788 var offset = this.bb!.__offset(this.bb_pos, 24); 2789 return offset ? this.bb!.readInt8(this.bb!.__vector(this.bb_pos + offset) + index) : 0; 2790}; 2791 2792/** 2793 * @returns number 2794 */ 2795v8Length():number { 2796 var offset = this.bb!.__offset(this.bb_pos, 24); 2797 return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; 2798}; 2799 2800/** 2801 * @returns Int8Array 2802 */ 2803v8Array():Int8Array|null { 2804 var offset = this.bb!.__offset(this.bb_pos, 24); 2805 return offset ? new Int8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null; 2806}; 2807 2808/** 2809 * @param number index 2810 * @returns number 2811 */ 2812vf64(index: number):number|null { 2813 var offset = this.bb!.__offset(this.bb_pos, 26); 2814 return offset ? this.bb!.readFloat64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : 0; 2815}; 2816 2817/** 2818 * @returns number 2819 */ 2820vf64Length():number { 2821 var offset = this.bb!.__offset(this.bb_pos, 26); 2822 return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; 2823}; 2824 2825/** 2826 * @returns Float64Array 2827 */ 2828vf64Array():Float64Array|null { 2829 var offset = this.bb!.__offset(this.bb_pos, 26); 2830 return offset ? new Float64Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null; 2831}; 2832 2833/** 2834 * @param flatbuffers.Builder builder 2835 */ 2836static startTypeAliases(builder:flatbuffers.Builder) { 2837 builder.startObject(12); 2838}; 2839 2840/** 2841 * @param flatbuffers.Builder builder 2842 * @param number i8 2843 */ 2844static addI8(builder:flatbuffers.Builder, i8:number) { 2845 builder.addFieldInt8(0, i8, 0); 2846}; 2847 2848/** 2849 * @param flatbuffers.Builder builder 2850 * @param number u8 2851 */ 2852static addU8(builder:flatbuffers.Builder, u8:number) { 2853 builder.addFieldInt8(1, u8, 0); 2854}; 2855 2856/** 2857 * @param flatbuffers.Builder builder 2858 * @param number i16 2859 */ 2860static addI16(builder:flatbuffers.Builder, i16:number) { 2861 builder.addFieldInt16(2, i16, 0); 2862}; 2863 2864/** 2865 * @param flatbuffers.Builder builder 2866 * @param number u16 2867 */ 2868static addU16(builder:flatbuffers.Builder, u16:number) { 2869 builder.addFieldInt16(3, u16, 0); 2870}; 2871 2872/** 2873 * @param flatbuffers.Builder builder 2874 * @param number i32 2875 */ 2876static addI32(builder:flatbuffers.Builder, i32:number) { 2877 builder.addFieldInt32(4, i32, 0); 2878}; 2879 2880/** 2881 * @param flatbuffers.Builder builder 2882 * @param number u32 2883 */ 2884static addU32(builder:flatbuffers.Builder, u32:number) { 2885 builder.addFieldInt32(5, u32, 0); 2886}; 2887 2888/** 2889 * @param flatbuffers.Builder builder 2890 * @param flatbuffers.Long i64 2891 */ 2892static addI64(builder:flatbuffers.Builder, i64:flatbuffers.Long) { 2893 builder.addFieldInt64(6, i64, builder.createLong(0, 0)); 2894}; 2895 2896/** 2897 * @param flatbuffers.Builder builder 2898 * @param flatbuffers.Long u64 2899 */ 2900static addU64(builder:flatbuffers.Builder, u64:flatbuffers.Long) { 2901 builder.addFieldInt64(7, u64, builder.createLong(0, 0)); 2902}; 2903 2904/** 2905 * @param flatbuffers.Builder builder 2906 * @param number f32 2907 */ 2908static addF32(builder:flatbuffers.Builder, f32:number) { 2909 builder.addFieldFloat32(8, f32, 0.0); 2910}; 2911 2912/** 2913 * @param flatbuffers.Builder builder 2914 * @param number f64 2915 */ 2916static addF64(builder:flatbuffers.Builder, f64:number) { 2917 builder.addFieldFloat64(9, f64, 0.0); 2918}; 2919 2920/** 2921 * @param flatbuffers.Builder builder 2922 * @param flatbuffers.Offset v8Offset 2923 */ 2924static addV8(builder:flatbuffers.Builder, v8Offset:flatbuffers.Offset) { 2925 builder.addFieldOffset(10, v8Offset, 0); 2926}; 2927 2928/** 2929 * @param flatbuffers.Builder builder 2930 * @param Array.<number> data 2931 * @returns flatbuffers.Offset 2932 */ 2933static createV8Vector(builder:flatbuffers.Builder, data:number[] | Uint8Array):flatbuffers.Offset { 2934 builder.startVector(1, data.length, 1); 2935 for (var i = data.length - 1; i >= 0; i--) { 2936 builder.addInt8(data[i]); 2937 } 2938 return builder.endVector(); 2939}; 2940 2941/** 2942 * @param flatbuffers.Builder builder 2943 * @param number numElems 2944 */ 2945static startV8Vector(builder:flatbuffers.Builder, numElems:number) { 2946 builder.startVector(1, numElems, 1); 2947}; 2948 2949/** 2950 * @param flatbuffers.Builder builder 2951 * @param flatbuffers.Offset vf64Offset 2952 */ 2953static addVf64(builder:flatbuffers.Builder, vf64Offset:flatbuffers.Offset) { 2954 builder.addFieldOffset(11, vf64Offset, 0); 2955}; 2956 2957/** 2958 * @param flatbuffers.Builder builder 2959 * @param Array.<number> data 2960 * @returns flatbuffers.Offset 2961 */ 2962static createVf64Vector(builder:flatbuffers.Builder, data:number[] | Uint8Array):flatbuffers.Offset { 2963 builder.startVector(8, data.length, 8); 2964 for (var i = data.length - 1; i >= 0; i--) { 2965 builder.addFloat64(data[i]); 2966 } 2967 return builder.endVector(); 2968}; 2969 2970/** 2971 * @param flatbuffers.Builder builder 2972 * @param number numElems 2973 */ 2974static startVf64Vector(builder:flatbuffers.Builder, numElems:number) { 2975 builder.startVector(8, numElems, 8); 2976}; 2977 2978/** 2979 * @param flatbuffers.Builder builder 2980 * @returns flatbuffers.Offset 2981 */ 2982static endTypeAliases(builder:flatbuffers.Builder):flatbuffers.Offset { 2983 var offset = builder.endObject(); 2984 return offset; 2985}; 2986 2987static createTypeAliases(builder:flatbuffers.Builder, i8:number, u8:number, i16:number, u16:number, i32:number, u32:number, i64:flatbuffers.Long, u64:flatbuffers.Long, f32:number, f64:number, v8Offset:flatbuffers.Offset, vf64Offset:flatbuffers.Offset):flatbuffers.Offset { 2988 TypeAliases.startTypeAliases(builder); 2989 TypeAliases.addI8(builder, i8); 2990 TypeAliases.addU8(builder, u8); 2991 TypeAliases.addI16(builder, i16); 2992 TypeAliases.addU16(builder, u16); 2993 TypeAliases.addI32(builder, i32); 2994 TypeAliases.addU32(builder, u32); 2995 TypeAliases.addI64(builder, i64); 2996 TypeAliases.addU64(builder, u64); 2997 TypeAliases.addF32(builder, f32); 2998 TypeAliases.addF64(builder, f64); 2999 TypeAliases.addV8(builder, v8Offset); 3000 TypeAliases.addVf64(builder, vf64Offset); 3001 return TypeAliases.endTypeAliases(builder); 3002} 3003} 3004} 3005