1 // automatically generated by the FlatBuffers compiler, do not modify
7 var MyGame = MyGame || {};
13 MyGame.Example = MyGame.Example || {};
19 MyGame.Example2 = MyGame.Example2 || {};
25 MyGame.OtherNameSpace = MyGame.OtherNameSpace || {};
28 * Composite components of Monster color.
32 MyGame.Example.Color = {
37 * Green is bit_flag with value (1u << 1)
42 * \brief color Blue (1u << 3)
48 * Composite components of Monster color.
52 MyGame.Example.ColorName = {
57 * Green is bit_flag with value (1u << 1)
62 * \brief color Blue (1u << 3)
70 MyGame.Example.Race = {
80 MyGame.Example.RaceName = {
90 MyGame.Example.Any = {
93 TestSimpleTableWithEnum: 2,
94 MyGame_Example2_Monster: 3
100 MyGame.Example.AnyName = {
103 '2': 'TestSimpleTableWithEnum',
104 '3': 'MyGame_Example2_Monster'
110 MyGame.Example.AnyUniqueAliases = {
120 MyGame.Example.AnyUniqueAliasesName = {
130 MyGame.Example.AnyAmbiguousAliases = {
140 MyGame.Example.AnyAmbiguousAliasesName = {
150 MyGame.InParentNamespace = function() {
152 * @type {flatbuffers.ByteBuffer}
164 * @param {flatbuffers.ByteBuffer} bb
165 * @returns {MyGame.InParentNamespace}
167 MyGame.InParentNamespace.prototype.__init = function(i, bb) {
174 * @param {flatbuffers.ByteBuffer} bb
175 * @param {MyGame.InParentNamespace=} obj
176 * @returns {MyGame.InParentNamespace}
178 MyGame.InParentNamespace.getRootAsInParentNamespace = function(bb, obj) {
179 return (obj || new MyGame.InParentNamespace).__init(bb.readInt32(bb.position()) + bb.position(), bb);
183 * @param {flatbuffers.ByteBuffer} bb
184 * @param {MyGame.InParentNamespace=} obj
185 * @returns {MyGame.InParentNamespace}
187 MyGame.InParentNamespace.getSizePrefixedRootAsInParentNamespace = function(bb, obj) {
188 return (obj || new MyGame.InParentNamespace).__init(bb.readInt32(bb.position()) + bb.position(), bb);
192 * @param {flatbuffers.Builder} builder
194 MyGame.InParentNamespace.startInParentNamespace = function(builder) {
195 builder.startObject(0);
199 * @param {flatbuffers.Builder} builder
200 * @returns {flatbuffers.Offset}
202 MyGame.InParentNamespace.endInParentNamespace = function(builder) {
203 var offset = builder.endObject();
208 * @param {flatbuffers.Builder} builder
209 * @returns {flatbuffers.Offset}
211 MyGame.InParentNamespace.createInParentNamespace = function(builder) {
212 MyGame.InParentNamespace.startInParentNamespace(builder);
213 return MyGame.InParentNamespace.endInParentNamespace(builder);
219 MyGame.Example2.Monster = function() {
221 * @type {flatbuffers.ByteBuffer}
233 * @param {flatbuffers.ByteBuffer} bb
234 * @returns {MyGame.Example2.Monster}
236 MyGame.Example2.Monster.prototype.__init = function(i, bb) {
243 * @param {flatbuffers.ByteBuffer} bb
244 * @param {MyGame.Example2.Monster=} obj
245 * @returns {MyGame.Example2.Monster}
247 MyGame.Example2.Monster.getRootAsMonster = function(bb, obj) {
248 return (obj || new MyGame.Example2.Monster).__init(bb.readInt32(bb.position()) + bb.position(), bb);
252 * @param {flatbuffers.ByteBuffer} bb
253 * @param {MyGame.Example2.Monster=} obj
254 * @returns {MyGame.Example2.Monster}
256 MyGame.Example2.Monster.getSizePrefixedRootAsMonster = function(bb, obj) {
257 return (obj || new MyGame.Example2.Monster).__init(bb.readInt32(bb.position()) + bb.position(), bb);
261 * @param {flatbuffers.Builder} builder
263 MyGame.Example2.Monster.startMonster = function(builder) {
264 builder.startObject(0);
268 * @param {flatbuffers.Builder} builder
269 * @returns {flatbuffers.Offset}
271 MyGame.Example2.Monster.endMonster = function(builder) {
272 var offset = builder.endObject();
277 * @param {flatbuffers.Builder} builder
278 * @returns {flatbuffers.Offset}
280 MyGame.Example2.Monster.createMonster = function(builder) {
281 MyGame.Example2.Monster.startMonster(builder);
282 return MyGame.Example2.Monster.endMonster(builder);
288 MyGame.Example.Test = function() {
290 * @type {flatbuffers.ByteBuffer}
302 * @param {flatbuffers.ByteBuffer} bb
303 * @returns {MyGame.Example.Test}
305 MyGame.Example.Test.prototype.__init = function(i, bb) {
314 MyGame.Example.Test.prototype.a = function() {
315 return this.bb.readInt16(this.bb_pos);
319 * @param {number} value
322 MyGame.Example.Test.prototype.mutate_a = function(value) {
323 var offset = this.bb.__offset(this.bb_pos, 0);
329 this.bb.writeInt16(this.bb_pos + offset, value);
336 MyGame.Example.Test.prototype.b = function() {
337 return this.bb.readInt8(this.bb_pos + 2);
341 * @param {number} value
344 MyGame.Example.Test.prototype.mutate_b = function(value) {
345 var offset = this.bb.__offset(this.bb_pos, 2);
351 this.bb.writeInt8(this.bb_pos + offset, value);
356 * @param {flatbuffers.Builder} builder
359 * @returns {flatbuffers.Offset}
361 MyGame.Example.Test.createTest = function(builder, a, b) {
364 builder.writeInt8(b);
365 builder.writeInt16(a);
366 return builder.offset();
372 MyGame.Example.TestSimpleTableWithEnum = function() {
374 * @type {flatbuffers.ByteBuffer}
386 * @param {flatbuffers.ByteBuffer} bb
387 * @returns {MyGame.Example.TestSimpleTableWithEnum}
389 MyGame.Example.TestSimpleTableWithEnum.prototype.__init = function(i, bb) {
396 * @param {flatbuffers.ByteBuffer} bb
397 * @param {MyGame.Example.TestSimpleTableWithEnum=} obj
398 * @returns {MyGame.Example.TestSimpleTableWithEnum}
400 MyGame.Example.TestSimpleTableWithEnum.getRootAsTestSimpleTableWithEnum = function(bb, obj) {
401 return (obj || new MyGame.Example.TestSimpleTableWithEnum).__init(bb.readInt32(bb.position()) + bb.position(), bb);
405 * @param {flatbuffers.ByteBuffer} bb
406 * @param {MyGame.Example.TestSimpleTableWithEnum=} obj
407 * @returns {MyGame.Example.TestSimpleTableWithEnum}
409 MyGame.Example.TestSimpleTableWithEnum.getSizePrefixedRootAsTestSimpleTableWithEnum = function(bb, obj) {
410 return (obj || new MyGame.Example.TestSimpleTableWithEnum).__init(bb.readInt32(bb.position()) + bb.position(), bb);
414 * @returns {MyGame.Example.Color}
416 MyGame.Example.TestSimpleTableWithEnum.prototype.color = function() {
417 var offset = this.bb.__offset(this.bb_pos, 4);
418 return offset ? /** @type {MyGame.Example.Color} */ (this.bb.readUint8(this.bb_pos + offset)) : MyGame.Example.Color.Green;
422 * @param {MyGame.Example.Color} value
425 MyGame.Example.TestSimpleTableWithEnum.prototype.mutate_color = function(value) {
426 var offset = this.bb.__offset(this.bb_pos, 4);
432 this.bb.writeUint8(this.bb_pos + offset, value);
437 * @param {flatbuffers.Builder} builder
439 MyGame.Example.TestSimpleTableWithEnum.startTestSimpleTableWithEnum = function(builder) {
440 builder.startObject(1);
444 * @param {flatbuffers.Builder} builder
445 * @param {MyGame.Example.Color} color
447 MyGame.Example.TestSimpleTableWithEnum.addColor = function(builder, color) {
448 builder.addFieldInt8(0, color, MyGame.Example.Color.Green);
452 * @param {flatbuffers.Builder} builder
453 * @returns {flatbuffers.Offset}
455 MyGame.Example.TestSimpleTableWithEnum.endTestSimpleTableWithEnum = function(builder) {
456 var offset = builder.endObject();
461 * @param {flatbuffers.Builder} builder
462 * @param {MyGame.Example.Color} color
463 * @returns {flatbuffers.Offset}
465 MyGame.Example.TestSimpleTableWithEnum.createTestSimpleTableWithEnum = function(builder, color) {
466 MyGame.Example.TestSimpleTableWithEnum.startTestSimpleTableWithEnum(builder);
467 MyGame.Example.TestSimpleTableWithEnum.addColor(builder, color);
468 return MyGame.Example.TestSimpleTableWithEnum.endTestSimpleTableWithEnum(builder);
474 MyGame.Example.Vec3 = function() {
476 * @type {flatbuffers.ByteBuffer}
488 * @param {flatbuffers.ByteBuffer} bb
489 * @returns {MyGame.Example.Vec3}
491 MyGame.Example.Vec3.prototype.__init = function(i, bb) {
500 MyGame.Example.Vec3.prototype.x = function() {
501 return this.bb.readFloat32(this.bb_pos);
505 * @param {number} value
508 MyGame.Example.Vec3.prototype.mutate_x = function(value) {
509 var offset = this.bb.__offset(this.bb_pos, 0);
515 this.bb.writeFloat32(this.bb_pos + offset, value);
522 MyGame.Example.Vec3.prototype.y = function() {
523 return this.bb.readFloat32(this.bb_pos + 4);
527 * @param {number} value
530 MyGame.Example.Vec3.prototype.mutate_y = function(value) {
531 var offset = this.bb.__offset(this.bb_pos, 4);
537 this.bb.writeFloat32(this.bb_pos + offset, value);
544 MyGame.Example.Vec3.prototype.z = function() {
545 return this.bb.readFloat32(this.bb_pos + 8);
549 * @param {number} value
552 MyGame.Example.Vec3.prototype.mutate_z = function(value) {
553 var offset = this.bb.__offset(this.bb_pos, 8);
559 this.bb.writeFloat32(this.bb_pos + offset, value);
566 MyGame.Example.Vec3.prototype.test1 = function() {
567 return this.bb.readFloat64(this.bb_pos + 16);
571 * @param {number} value
574 MyGame.Example.Vec3.prototype.mutate_test1 = function(value) {
575 var offset = this.bb.__offset(this.bb_pos, 16);
581 this.bb.writeFloat64(this.bb_pos + offset, value);
586 * @returns {MyGame.Example.Color}
588 MyGame.Example.Vec3.prototype.test2 = function() {
589 return /** @type {MyGame.Example.Color} */ (this.bb.readUint8(this.bb_pos + 24));
593 * @param {MyGame.Example.Color} value
596 MyGame.Example.Vec3.prototype.mutate_test2 = function(value) {
597 var offset = this.bb.__offset(this.bb_pos, 24);
603 this.bb.writeUint8(this.bb_pos + offset, value);
608 * @param {MyGame.Example.Test=} obj
609 * @returns {MyGame.Example.Test|null}
611 MyGame.Example.Vec3.prototype.test3 = function(obj) {
612 return (obj || new MyGame.Example.Test).__init(this.bb_pos + 26, this.bb);
616 * @param {flatbuffers.Builder} builder
620 * @param {number} test1
621 * @param {MyGame.Example.Color} test2
622 * @param {number} test3_a
623 * @param {number} test3_b
624 * @returns {flatbuffers.Offset}
626 MyGame.Example.Vec3.createVec3 = function(builder, x, y, z, test1, test2, test3_a, test3_b) {
631 builder.writeInt8(test3_b);
632 builder.writeInt16(test3_a);
634 builder.writeInt8(test2);
635 builder.writeFloat64(test1);
637 builder.writeFloat32(z);
638 builder.writeFloat32(y);
639 builder.writeFloat32(x);
640 return builder.offset();
646 MyGame.Example.Ability = function() {
648 * @type {flatbuffers.ByteBuffer}
660 * @param {flatbuffers.ByteBuffer} bb
661 * @returns {MyGame.Example.Ability}
663 MyGame.Example.Ability.prototype.__init = function(i, bb) {
672 MyGame.Example.Ability.prototype.id = function() {
673 return this.bb.readUint32(this.bb_pos);
677 * @param {number} value
680 MyGame.Example.Ability.prototype.mutate_id = function(value) {
681 var offset = this.bb.__offset(this.bb_pos, 0);
687 this.bb.writeUint32(this.bb_pos + offset, value);
694 MyGame.Example.Ability.prototype.distance = function() {
695 return this.bb.readUint32(this.bb_pos + 4);
699 * @param {number} value
702 MyGame.Example.Ability.prototype.mutate_distance = function(value) {
703 var offset = this.bb.__offset(this.bb_pos, 4);
709 this.bb.writeUint32(this.bb_pos + offset, value);
714 * @param {flatbuffers.Builder} builder
716 * @param {number} distance
717 * @returns {flatbuffers.Offset}
719 MyGame.Example.Ability.createAbility = function(builder, id, distance) {
721 builder.writeInt32(distance);
722 builder.writeInt32(id);
723 return builder.offset();
729 MyGame.Example.Stat = function() {
731 * @type {flatbuffers.ByteBuffer}
743 * @param {flatbuffers.ByteBuffer} bb
744 * @returns {MyGame.Example.Stat}
746 MyGame.Example.Stat.prototype.__init = function(i, bb) {
753 * @param {flatbuffers.ByteBuffer} bb
754 * @param {MyGame.Example.Stat=} obj
755 * @returns {MyGame.Example.Stat}
757 MyGame.Example.Stat.getRootAsStat = function(bb, obj) {
758 return (obj || new MyGame.Example.Stat).__init(bb.readInt32(bb.position()) + bb.position(), bb);
762 * @param {flatbuffers.ByteBuffer} bb
763 * @param {MyGame.Example.Stat=} obj
764 * @returns {MyGame.Example.Stat}
766 MyGame.Example.Stat.getSizePrefixedRootAsStat = function(bb, obj) {
767 return (obj || new MyGame.Example.Stat).__init(bb.readInt32(bb.position()) + bb.position(), bb);
771 * @param {flatbuffers.Encoding=} optionalEncoding
772 * @returns {string|Uint8Array|null}
774 MyGame.Example.Stat.prototype.id = function(optionalEncoding) {
775 var offset = this.bb.__offset(this.bb_pos, 4);
776 return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
780 * @returns {flatbuffers.Long}
782 MyGame.Example.Stat.prototype.val = function() {
783 var offset = this.bb.__offset(this.bb_pos, 6);
784 return offset ? this.bb.readInt64(this.bb_pos + offset) : this.bb.createLong(0, 0);
788 * @param {flatbuffers.Long} value
791 MyGame.Example.Stat.prototype.mutate_val = function(value) {
792 var offset = this.bb.__offset(this.bb_pos, 6);
798 this.bb.writeInt64(this.bb_pos + offset, value);
805 MyGame.Example.Stat.prototype.count = function() {
806 var offset = this.bb.__offset(this.bb_pos, 8);
807 return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
811 * @param {number} value
814 MyGame.Example.Stat.prototype.mutate_count = function(value) {
815 var offset = this.bb.__offset(this.bb_pos, 8);
821 this.bb.writeUint16(this.bb_pos + offset, value);
826 * @param {flatbuffers.Builder} builder
828 MyGame.Example.Stat.startStat = function(builder) {
829 builder.startObject(3);
833 * @param {flatbuffers.Builder} builder
834 * @param {flatbuffers.Offset} idOffset
836 MyGame.Example.Stat.addId = function(builder, idOffset) {
837 builder.addFieldOffset(0, idOffset, 0);
841 * @param {flatbuffers.Builder} builder
842 * @param {flatbuffers.Long} val
844 MyGame.Example.Stat.addVal = function(builder, val) {
845 builder.addFieldInt64(1, val, builder.createLong(0, 0));
849 * @param {flatbuffers.Builder} builder
850 * @param {number} count
852 MyGame.Example.Stat.addCount = function(builder, count) {
853 builder.addFieldInt16(2, count, 0);
857 * @param {flatbuffers.Builder} builder
858 * @returns {flatbuffers.Offset}
860 MyGame.Example.Stat.endStat = function(builder) {
861 var offset = builder.endObject();
866 * @param {flatbuffers.Builder} builder
867 * @param {flatbuffers.Offset} idOffset
868 * @param {flatbuffers.Long} val
869 * @param {number} count
870 * @returns {flatbuffers.Offset}
872 MyGame.Example.Stat.createStat = function(builder, idOffset, val, count) {
873 MyGame.Example.Stat.startStat(builder);
874 MyGame.Example.Stat.addId(builder, idOffset);
875 MyGame.Example.Stat.addVal(builder, val);
876 MyGame.Example.Stat.addCount(builder, count);
877 return MyGame.Example.Stat.endStat(builder);
883 MyGame.Example.Referrable = function() {
885 * @type {flatbuffers.ByteBuffer}
897 * @param {flatbuffers.ByteBuffer} bb
898 * @returns {MyGame.Example.Referrable}
900 MyGame.Example.Referrable.prototype.__init = function(i, bb) {
907 * @param {flatbuffers.ByteBuffer} bb
908 * @param {MyGame.Example.Referrable=} obj
909 * @returns {MyGame.Example.Referrable}
911 MyGame.Example.Referrable.getRootAsReferrable = function(bb, obj) {
912 return (obj || new MyGame.Example.Referrable).__init(bb.readInt32(bb.position()) + bb.position(), bb);
916 * @param {flatbuffers.ByteBuffer} bb
917 * @param {MyGame.Example.Referrable=} obj
918 * @returns {MyGame.Example.Referrable}
920 MyGame.Example.Referrable.getSizePrefixedRootAsReferrable = function(bb, obj) {
921 return (obj || new MyGame.Example.Referrable).__init(bb.readInt32(bb.position()) + bb.position(), bb);
925 * @returns {flatbuffers.Long}
927 MyGame.Example.Referrable.prototype.id = function() {
928 var offset = this.bb.__offset(this.bb_pos, 4);
929 return offset ? this.bb.readUint64(this.bb_pos + offset) : this.bb.createLong(0, 0);
933 * @param {flatbuffers.Long} value
936 MyGame.Example.Referrable.prototype.mutate_id = function(value) {
937 var offset = this.bb.__offset(this.bb_pos, 4);
943 this.bb.writeUint64(this.bb_pos + offset, value);
948 * @param {flatbuffers.Builder} builder
950 MyGame.Example.Referrable.startReferrable = function(builder) {
951 builder.startObject(1);
955 * @param {flatbuffers.Builder} builder
956 * @param {flatbuffers.Long} id
958 MyGame.Example.Referrable.addId = function(builder, id) {
959 builder.addFieldInt64(0, id, builder.createLong(0, 0));
963 * @param {flatbuffers.Builder} builder
964 * @returns {flatbuffers.Offset}
966 MyGame.Example.Referrable.endReferrable = function(builder) {
967 var offset = builder.endObject();
972 * @param {flatbuffers.Builder} builder
973 * @param {flatbuffers.Long} id
974 * @returns {flatbuffers.Offset}
976 MyGame.Example.Referrable.createReferrable = function(builder, id) {
977 MyGame.Example.Referrable.startReferrable(builder);
978 MyGame.Example.Referrable.addId(builder, id);
979 return MyGame.Example.Referrable.endReferrable(builder);
983 * an example documentation comment: monster object
987 MyGame.Example.Monster = function() {
989 * @type {flatbuffers.ByteBuffer}
1001 * @param {flatbuffers.ByteBuffer} bb
1002 * @returns {MyGame.Example.Monster}
1004 MyGame.Example.Monster.prototype.__init = function(i, bb) {
1011 * @param {flatbuffers.ByteBuffer} bb
1012 * @param {MyGame.Example.Monster=} obj
1013 * @returns {MyGame.Example.Monster}
1015 MyGame.Example.Monster.getRootAsMonster = function(bb, obj) {
1016 return (obj || new MyGame.Example.Monster).__init(bb.readInt32(bb.position()) + bb.position(), bb);
1020 * @param {flatbuffers.ByteBuffer} bb
1021 * @param {MyGame.Example.Monster=} obj
1022 * @returns {MyGame.Example.Monster}
1024 MyGame.Example.Monster.getSizePrefixedRootAsMonster = function(bb, obj) {
1025 return (obj || new MyGame.Example.Monster).__init(bb.readInt32(bb.position()) + bb.position(), bb);
1029 * @param {flatbuffers.ByteBuffer} bb
1030 * @returns {boolean}
1032 MyGame.Example.Monster.bufferHasIdentifier = function(bb) {
1033 return bb.__has_identifier('MONS');
1037 * @param {MyGame.Example.Vec3=} obj
1038 * @returns {MyGame.Example.Vec3|null}
1040 MyGame.Example.Monster.prototype.pos = function(obj) {
1041 var offset = this.bb.__offset(this.bb_pos, 4);
1042 return offset ? (obj || new MyGame.Example.Vec3).__init(this.bb_pos + offset, this.bb) : null;
1048 MyGame.Example.Monster.prototype.mana = function() {
1049 var offset = this.bb.__offset(this.bb_pos, 6);
1050 return offset ? this.bb.readInt16(this.bb_pos + offset) : 150;
1054 * @param {number} value
1055 * @returns {boolean}
1057 MyGame.Example.Monster.prototype.mutate_mana = function(value) {
1058 var offset = this.bb.__offset(this.bb_pos, 6);
1064 this.bb.writeInt16(this.bb_pos + offset, value);
1071 MyGame.Example.Monster.prototype.hp = function() {
1072 var offset = this.bb.__offset(this.bb_pos, 8);
1073 return offset ? this.bb.readInt16(this.bb_pos + offset) : 100;
1077 * @param {number} value
1078 * @returns {boolean}
1080 MyGame.Example.Monster.prototype.mutate_hp = function(value) {
1081 var offset = this.bb.__offset(this.bb_pos, 8);
1087 this.bb.writeInt16(this.bb_pos + offset, value);
1092 * @param {flatbuffers.Encoding=} optionalEncoding
1093 * @returns {string|Uint8Array|null}
1095 MyGame.Example.Monster.prototype.name = function(optionalEncoding) {
1096 var offset = this.bb.__offset(this.bb_pos, 10);
1097 return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
1101 * @param {number} index
1104 MyGame.Example.Monster.prototype.inventory = function(index) {
1105 var offset = this.bb.__offset(this.bb_pos, 14);
1106 return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
1112 MyGame.Example.Monster.prototype.inventoryLength = function() {
1113 var offset = this.bb.__offset(this.bb_pos, 14);
1114 return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
1118 * @returns {Uint8Array}
1120 MyGame.Example.Monster.prototype.inventoryArray = function() {
1121 var offset = this.bb.__offset(this.bb_pos, 14);
1122 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;
1126 * @returns {MyGame.Example.Color}
1128 MyGame.Example.Monster.prototype.color = function() {
1129 var offset = this.bb.__offset(this.bb_pos, 16);
1130 return offset ? /** @type {MyGame.Example.Color} */ (this.bb.readUint8(this.bb_pos + offset)) : MyGame.Example.Color.Blue;
1134 * @param {MyGame.Example.Color} value
1135 * @returns {boolean}
1137 MyGame.Example.Monster.prototype.mutate_color = function(value) {
1138 var offset = this.bb.__offset(this.bb_pos, 16);
1144 this.bb.writeUint8(this.bb_pos + offset, value);
1149 * @returns {MyGame.Example.Any}
1151 MyGame.Example.Monster.prototype.testType = function() {
1152 var offset = this.bb.__offset(this.bb_pos, 18);
1153 return offset ? /** @type {MyGame.Example.Any} */ (this.bb.readUint8(this.bb_pos + offset)) : MyGame.Example.Any.NONE;
1157 * @param {flatbuffers.Table} obj
1158 * @returns {?flatbuffers.Table}
1160 MyGame.Example.Monster.prototype.test = function(obj) {
1161 var offset = this.bb.__offset(this.bb_pos, 20);
1162 return offset ? this.bb.__union(obj, this.bb_pos + offset) : null;
1166 * @param {number} index
1167 * @param {MyGame.Example.Test=} obj
1168 * @returns {MyGame.Example.Test}
1170 MyGame.Example.Monster.prototype.test4 = function(index, obj) {
1171 var offset = this.bb.__offset(this.bb_pos, 22);
1172 return offset ? (obj || new MyGame.Example.Test).__init(this.bb.__vector(this.bb_pos + offset) + index * 4, this.bb) : null;
1178 MyGame.Example.Monster.prototype.test4Length = function() {
1179 var offset = this.bb.__offset(this.bb_pos, 22);
1180 return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
1184 * @param {number} index
1185 * @param {flatbuffers.Encoding=} optionalEncoding
1186 * @returns {string|Uint8Array}
1188 MyGame.Example.Monster.prototype.testarrayofstring = function(index, optionalEncoding) {
1189 var offset = this.bb.__offset(this.bb_pos, 24);
1190 return offset ? this.bb.__string(this.bb.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
1196 MyGame.Example.Monster.prototype.testarrayofstringLength = function() {
1197 var offset = this.bb.__offset(this.bb_pos, 24);
1198 return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
1202 * an example documentation comment: this will end up in the generated code
1205 * @param {number} index
1206 * @param {MyGame.Example.Monster=} obj
1207 * @returns {MyGame.Example.Monster}
1209 MyGame.Example.Monster.prototype.testarrayoftables = function(index, obj) {
1210 var offset = this.bb.__offset(this.bb_pos, 26);
1211 return offset ? (obj || new MyGame.Example.Monster).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
1217 MyGame.Example.Monster.prototype.testarrayoftablesLength = function() {
1218 var offset = this.bb.__offset(this.bb_pos, 26);
1219 return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
1223 * @param {MyGame.Example.Monster=} obj
1224 * @returns {MyGame.Example.Monster|null}
1226 MyGame.Example.Monster.prototype.enemy = function(obj) {
1227 var offset = this.bb.__offset(this.bb_pos, 28);
1228 return offset ? (obj || new MyGame.Example.Monster).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
1232 * @param {number} index
1235 MyGame.Example.Monster.prototype.testnestedflatbuffer = function(index) {
1236 var offset = this.bb.__offset(this.bb_pos, 30);
1237 return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
1243 MyGame.Example.Monster.prototype.testnestedflatbufferLength = function() {
1244 var offset = this.bb.__offset(this.bb_pos, 30);
1245 return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
1249 * @returns {Uint8Array}
1251 MyGame.Example.Monster.prototype.testnestedflatbufferArray = function() {
1252 var offset = this.bb.__offset(this.bb_pos, 30);
1253 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;
1257 * @param {MyGame.Example.Stat=} obj
1258 * @returns {MyGame.Example.Stat|null}
1260 MyGame.Example.Monster.prototype.testempty = function(obj) {
1261 var offset = this.bb.__offset(this.bb_pos, 32);
1262 return offset ? (obj || new MyGame.Example.Stat).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
1266 * @returns {boolean}
1268 MyGame.Example.Monster.prototype.testbool = function() {
1269 var offset = this.bb.__offset(this.bb_pos, 34);
1270 return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
1274 * @param {boolean} value
1275 * @returns {boolean}
1277 MyGame.Example.Monster.prototype.mutate_testbool = function(value) {
1278 var offset = this.bb.__offset(this.bb_pos, 34);
1284 this.bb.writeInt8(this.bb_pos + offset, value);
1291 MyGame.Example.Monster.prototype.testhashs32Fnv1 = function() {
1292 var offset = this.bb.__offset(this.bb_pos, 36);
1293 return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
1297 * @param {number} value
1298 * @returns {boolean}
1300 MyGame.Example.Monster.prototype.mutate_testhashs32_fnv1 = function(value) {
1301 var offset = this.bb.__offset(this.bb_pos, 36);
1307 this.bb.writeInt32(this.bb_pos + offset, value);
1314 MyGame.Example.Monster.prototype.testhashu32Fnv1 = function() {
1315 var offset = this.bb.__offset(this.bb_pos, 38);
1316 return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
1320 * @param {number} value
1321 * @returns {boolean}
1323 MyGame.Example.Monster.prototype.mutate_testhashu32_fnv1 = function(value) {
1324 var offset = this.bb.__offset(this.bb_pos, 38);
1330 this.bb.writeUint32(this.bb_pos + offset, value);
1335 * @returns {flatbuffers.Long}
1337 MyGame.Example.Monster.prototype.testhashs64Fnv1 = function() {
1338 var offset = this.bb.__offset(this.bb_pos, 40);
1339 return offset ? this.bb.readInt64(this.bb_pos + offset) : this.bb.createLong(0, 0);
1343 * @param {flatbuffers.Long} value
1344 * @returns {boolean}
1346 MyGame.Example.Monster.prototype.mutate_testhashs64_fnv1 = function(value) {
1347 var offset = this.bb.__offset(this.bb_pos, 40);
1353 this.bb.writeInt64(this.bb_pos + offset, value);
1358 * @returns {flatbuffers.Long}
1360 MyGame.Example.Monster.prototype.testhashu64Fnv1 = function() {
1361 var offset = this.bb.__offset(this.bb_pos, 42);
1362 return offset ? this.bb.readUint64(this.bb_pos + offset) : this.bb.createLong(0, 0);
1366 * @param {flatbuffers.Long} value
1367 * @returns {boolean}
1369 MyGame.Example.Monster.prototype.mutate_testhashu64_fnv1 = function(value) {
1370 var offset = this.bb.__offset(this.bb_pos, 42);
1376 this.bb.writeUint64(this.bb_pos + offset, value);
1383 MyGame.Example.Monster.prototype.testhashs32Fnv1a = function() {
1384 var offset = this.bb.__offset(this.bb_pos, 44);
1385 return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
1389 * @param {number} value
1390 * @returns {boolean}
1392 MyGame.Example.Monster.prototype.mutate_testhashs32_fnv1a = function(value) {
1393 var offset = this.bb.__offset(this.bb_pos, 44);
1399 this.bb.writeInt32(this.bb_pos + offset, value);
1406 MyGame.Example.Monster.prototype.testhashu32Fnv1a = function() {
1407 var offset = this.bb.__offset(this.bb_pos, 46);
1408 return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
1412 * @param {number} value
1413 * @returns {boolean}
1415 MyGame.Example.Monster.prototype.mutate_testhashu32_fnv1a = function(value) {
1416 var offset = this.bb.__offset(this.bb_pos, 46);
1422 this.bb.writeUint32(this.bb_pos + offset, value);
1427 * @returns {flatbuffers.Long}
1429 MyGame.Example.Monster.prototype.testhashs64Fnv1a = function() {
1430 var offset = this.bb.__offset(this.bb_pos, 48);
1431 return offset ? this.bb.readInt64(this.bb_pos + offset) : this.bb.createLong(0, 0);
1435 * @param {flatbuffers.Long} value
1436 * @returns {boolean}
1438 MyGame.Example.Monster.prototype.mutate_testhashs64_fnv1a = function(value) {
1439 var offset = this.bb.__offset(this.bb_pos, 48);
1445 this.bb.writeInt64(this.bb_pos + offset, value);
1450 * @returns {flatbuffers.Long}
1452 MyGame.Example.Monster.prototype.testhashu64Fnv1a = function() {
1453 var offset = this.bb.__offset(this.bb_pos, 50);
1454 return offset ? this.bb.readUint64(this.bb_pos + offset) : this.bb.createLong(0, 0);
1458 * @param {flatbuffers.Long} value
1459 * @returns {boolean}
1461 MyGame.Example.Monster.prototype.mutate_testhashu64_fnv1a = function(value) {
1462 var offset = this.bb.__offset(this.bb_pos, 50);
1468 this.bb.writeUint64(this.bb_pos + offset, value);
1473 * @param {number} index
1474 * @returns {boolean}
1476 MyGame.Example.Monster.prototype.testarrayofbools = function(index) {
1477 var offset = this.bb.__offset(this.bb_pos, 52);
1478 return offset ? !!this.bb.readInt8(this.bb.__vector(this.bb_pos + offset) + index) : false;
1484 MyGame.Example.Monster.prototype.testarrayofboolsLength = function() {
1485 var offset = this.bb.__offset(this.bb_pos, 52);
1486 return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
1490 * @returns {Int8Array}
1492 MyGame.Example.Monster.prototype.testarrayofboolsArray = function() {
1493 var offset = this.bb.__offset(this.bb_pos, 52);
1494 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;
1500 MyGame.Example.Monster.prototype.testf = function() {
1501 var offset = this.bb.__offset(this.bb_pos, 54);
1502 return offset ? this.bb.readFloat32(this.bb_pos + offset) : 3.14159;
1506 * @param {number} value
1507 * @returns {boolean}
1509 MyGame.Example.Monster.prototype.mutate_testf = function(value) {
1510 var offset = this.bb.__offset(this.bb_pos, 54);
1516 this.bb.writeFloat32(this.bb_pos + offset, value);
1523 MyGame.Example.Monster.prototype.testf2 = function() {
1524 var offset = this.bb.__offset(this.bb_pos, 56);
1525 return offset ? this.bb.readFloat32(this.bb_pos + offset) : 3.0;
1529 * @param {number} value
1530 * @returns {boolean}
1532 MyGame.Example.Monster.prototype.mutate_testf2 = function(value) {
1533 var offset = this.bb.__offset(this.bb_pos, 56);
1539 this.bb.writeFloat32(this.bb_pos + offset, value);
1546 MyGame.Example.Monster.prototype.testf3 = function() {
1547 var offset = this.bb.__offset(this.bb_pos, 58);
1548 return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0.0;
1552 * @param {number} value
1553 * @returns {boolean}
1555 MyGame.Example.Monster.prototype.mutate_testf3 = function(value) {
1556 var offset = this.bb.__offset(this.bb_pos, 58);
1562 this.bb.writeFloat32(this.bb_pos + offset, value);
1567 * @param {number} index
1568 * @param {flatbuffers.Encoding=} optionalEncoding
1569 * @returns {string|Uint8Array}
1571 MyGame.Example.Monster.prototype.testarrayofstring2 = function(index, optionalEncoding) {
1572 var offset = this.bb.__offset(this.bb_pos, 60);
1573 return offset ? this.bb.__string(this.bb.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
1579 MyGame.Example.Monster.prototype.testarrayofstring2Length = function() {
1580 var offset = this.bb.__offset(this.bb_pos, 60);
1581 return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
1585 * @param {number} index
1586 * @param {MyGame.Example.Ability=} obj
1587 * @returns {MyGame.Example.Ability}
1589 MyGame.Example.Monster.prototype.testarrayofsortedstruct = function(index, obj) {
1590 var offset = this.bb.__offset(this.bb_pos, 62);
1591 return offset ? (obj || new MyGame.Example.Ability).__init(this.bb.__vector(this.bb_pos + offset) + index * 8, this.bb) : null;
1597 MyGame.Example.Monster.prototype.testarrayofsortedstructLength = function() {
1598 var offset = this.bb.__offset(this.bb_pos, 62);
1599 return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
1603 * @param {number} index
1606 MyGame.Example.Monster.prototype.flex = function(index) {
1607 var offset = this.bb.__offset(this.bb_pos, 64);
1608 return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
1614 MyGame.Example.Monster.prototype.flexLength = function() {
1615 var offset = this.bb.__offset(this.bb_pos, 64);
1616 return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
1620 * @returns {Uint8Array}
1622 MyGame.Example.Monster.prototype.flexArray = function() {
1623 var offset = this.bb.__offset(this.bb_pos, 64);
1624 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;
1628 * @param {number} index
1629 * @param {MyGame.Example.Test=} obj
1630 * @returns {MyGame.Example.Test}
1632 MyGame.Example.Monster.prototype.test5 = function(index, obj) {
1633 var offset = this.bb.__offset(this.bb_pos, 66);
1634 return offset ? (obj || new MyGame.Example.Test).__init(this.bb.__vector(this.bb_pos + offset) + index * 4, this.bb) : null;
1640 MyGame.Example.Monster.prototype.test5Length = function() {
1641 var offset = this.bb.__offset(this.bb_pos, 66);
1642 return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
1646 * @param {number} index
1647 * @returns {flatbuffers.Long}
1649 MyGame.Example.Monster.prototype.vectorOfLongs = function(index) {
1650 var offset = this.bb.__offset(this.bb_pos, 68);
1651 return offset ? this.bb.readInt64(this.bb.__vector(this.bb_pos + offset) + index * 8) : this.bb.createLong(0, 0);
1657 MyGame.Example.Monster.prototype.vectorOfLongsLength = function() {
1658 var offset = this.bb.__offset(this.bb_pos, 68);
1659 return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
1663 * @param {number} index
1666 MyGame.Example.Monster.prototype.vectorOfDoubles = function(index) {
1667 var offset = this.bb.__offset(this.bb_pos, 70);
1668 return offset ? this.bb.readFloat64(this.bb.__vector(this.bb_pos + offset) + index * 8) : 0;
1674 MyGame.Example.Monster.prototype.vectorOfDoublesLength = function() {
1675 var offset = this.bb.__offset(this.bb_pos, 70);
1676 return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
1680 * @returns {Float64Array}
1682 MyGame.Example.Monster.prototype.vectorOfDoublesArray = function() {
1683 var offset = this.bb.__offset(this.bb_pos, 70);
1684 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;
1688 * @param {MyGame.InParentNamespace=} obj
1689 * @returns {MyGame.InParentNamespace|null}
1691 MyGame.Example.Monster.prototype.parentNamespaceTest = function(obj) {
1692 var offset = this.bb.__offset(this.bb_pos, 72);
1693 return offset ? (obj || new MyGame.InParentNamespace).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
1697 * @param {number} index
1698 * @param {MyGame.Example.Referrable=} obj
1699 * @returns {MyGame.Example.Referrable}
1701 MyGame.Example.Monster.prototype.vectorOfReferrables = function(index, obj) {
1702 var offset = this.bb.__offset(this.bb_pos, 74);
1703 return offset ? (obj || new MyGame.Example.Referrable).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
1709 MyGame.Example.Monster.prototype.vectorOfReferrablesLength = function() {
1710 var offset = this.bb.__offset(this.bb_pos, 74);
1711 return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
1715 * @returns {flatbuffers.Long}
1717 MyGame.Example.Monster.prototype.singleWeakReference = function() {
1718 var offset = this.bb.__offset(this.bb_pos, 76);
1719 return offset ? this.bb.readUint64(this.bb_pos + offset) : this.bb.createLong(0, 0);
1723 * @param {flatbuffers.Long} value
1724 * @returns {boolean}
1726 MyGame.Example.Monster.prototype.mutate_single_weak_reference = function(value) {
1727 var offset = this.bb.__offset(this.bb_pos, 76);
1733 this.bb.writeUint64(this.bb_pos + offset, value);
1738 * @param {number} index
1739 * @returns {flatbuffers.Long}
1741 MyGame.Example.Monster.prototype.vectorOfWeakReferences = function(index) {
1742 var offset = this.bb.__offset(this.bb_pos, 78);
1743 return offset ? this.bb.readUint64(this.bb.__vector(this.bb_pos + offset) + index * 8) : this.bb.createLong(0, 0);
1749 MyGame.Example.Monster.prototype.vectorOfWeakReferencesLength = function() {
1750 var offset = this.bb.__offset(this.bb_pos, 78);
1751 return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
1755 * @param {number} index
1756 * @param {MyGame.Example.Referrable=} obj
1757 * @returns {MyGame.Example.Referrable}
1759 MyGame.Example.Monster.prototype.vectorOfStrongReferrables = function(index, obj) {
1760 var offset = this.bb.__offset(this.bb_pos, 80);
1761 return offset ? (obj || new MyGame.Example.Referrable).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
1767 MyGame.Example.Monster.prototype.vectorOfStrongReferrablesLength = function() {
1768 var offset = this.bb.__offset(this.bb_pos, 80);
1769 return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
1773 * @returns {flatbuffers.Long}
1775 MyGame.Example.Monster.prototype.coOwningReference = function() {
1776 var offset = this.bb.__offset(this.bb_pos, 82);
1777 return offset ? this.bb.readUint64(this.bb_pos + offset) : this.bb.createLong(0, 0);
1781 * @param {flatbuffers.Long} value
1782 * @returns {boolean}
1784 MyGame.Example.Monster.prototype.mutate_co_owning_reference = function(value) {
1785 var offset = this.bb.__offset(this.bb_pos, 82);
1791 this.bb.writeUint64(this.bb_pos + offset, value);
1796 * @param {number} index
1797 * @returns {flatbuffers.Long}
1799 MyGame.Example.Monster.prototype.vectorOfCoOwningReferences = function(index) {
1800 var offset = this.bb.__offset(this.bb_pos, 84);
1801 return offset ? this.bb.readUint64(this.bb.__vector(this.bb_pos + offset) + index * 8) : this.bb.createLong(0, 0);
1807 MyGame.Example.Monster.prototype.vectorOfCoOwningReferencesLength = function() {
1808 var offset = this.bb.__offset(this.bb_pos, 84);
1809 return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
1813 * @returns {flatbuffers.Long}
1815 MyGame.Example.Monster.prototype.nonOwningReference = function() {
1816 var offset = this.bb.__offset(this.bb_pos, 86);
1817 return offset ? this.bb.readUint64(this.bb_pos + offset) : this.bb.createLong(0, 0);
1821 * @param {flatbuffers.Long} value
1822 * @returns {boolean}
1824 MyGame.Example.Monster.prototype.mutate_non_owning_reference = function(value) {
1825 var offset = this.bb.__offset(this.bb_pos, 86);
1831 this.bb.writeUint64(this.bb_pos + offset, value);
1836 * @param {number} index
1837 * @returns {flatbuffers.Long}
1839 MyGame.Example.Monster.prototype.vectorOfNonOwningReferences = function(index) {
1840 var offset = this.bb.__offset(this.bb_pos, 88);
1841 return offset ? this.bb.readUint64(this.bb.__vector(this.bb_pos + offset) + index * 8) : this.bb.createLong(0, 0);
1847 MyGame.Example.Monster.prototype.vectorOfNonOwningReferencesLength = function() {
1848 var offset = this.bb.__offset(this.bb_pos, 88);
1849 return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
1853 * @returns {MyGame.Example.AnyUniqueAliases}
1855 MyGame.Example.Monster.prototype.anyUniqueType = function() {
1856 var offset = this.bb.__offset(this.bb_pos, 90);
1857 return offset ? /** @type {MyGame.Example.AnyUniqueAliases} */ (this.bb.readUint8(this.bb_pos + offset)) : MyGame.Example.AnyUniqueAliases.NONE;
1861 * @param {flatbuffers.Table} obj
1862 * @returns {?flatbuffers.Table}
1864 MyGame.Example.Monster.prototype.anyUnique = function(obj) {
1865 var offset = this.bb.__offset(this.bb_pos, 92);
1866 return offset ? this.bb.__union(obj, this.bb_pos + offset) : null;
1870 * @returns {MyGame.Example.AnyAmbiguousAliases}
1872 MyGame.Example.Monster.prototype.anyAmbiguousType = function() {
1873 var offset = this.bb.__offset(this.bb_pos, 94);
1874 return offset ? /** @type {MyGame.Example.AnyAmbiguousAliases} */ (this.bb.readUint8(this.bb_pos + offset)) : MyGame.Example.AnyAmbiguousAliases.NONE;
1878 * @param {flatbuffers.Table} obj
1879 * @returns {?flatbuffers.Table}
1881 MyGame.Example.Monster.prototype.anyAmbiguous = function(obj) {
1882 var offset = this.bb.__offset(this.bb_pos, 96);
1883 return offset ? this.bb.__union(obj, this.bb_pos + offset) : null;
1887 * @param {number} index
1888 * @returns {MyGame.Example.Color}
1890 MyGame.Example.Monster.prototype.vectorOfEnums = function(index) {
1891 var offset = this.bb.__offset(this.bb_pos, 98);
1892 return offset ? /** @type {MyGame.Example.Color} */ (this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index)) : /** @type {MyGame.Example.Color} */ (0);
1898 MyGame.Example.Monster.prototype.vectorOfEnumsLength = function() {
1899 var offset = this.bb.__offset(this.bb_pos, 98);
1900 return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
1904 * @returns {Uint8Array}
1906 MyGame.Example.Monster.prototype.vectorOfEnumsArray = function() {
1907 var offset = this.bb.__offset(this.bb_pos, 98);
1908 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;
1912 * @returns {MyGame.Example.Race}
1914 MyGame.Example.Monster.prototype.signedEnum = function() {
1915 var offset = this.bb.__offset(this.bb_pos, 100);
1916 return offset ? /** @type {MyGame.Example.Race} */ (this.bb.readInt8(this.bb_pos + offset)) : MyGame.Example.Race.None;
1920 * @param {MyGame.Example.Race} value
1921 * @returns {boolean}
1923 MyGame.Example.Monster.prototype.mutate_signed_enum = function(value) {
1924 var offset = this.bb.__offset(this.bb_pos, 100);
1930 this.bb.writeInt8(this.bb_pos + offset, value);
1935 * @param {flatbuffers.Builder} builder
1937 MyGame.Example.Monster.startMonster = function(builder) {
1938 builder.startObject(49);
1942 * @param {flatbuffers.Builder} builder
1943 * @param {flatbuffers.Offset} posOffset
1945 MyGame.Example.Monster.addPos = function(builder, posOffset) {
1946 builder.addFieldStruct(0, posOffset, 0);
1950 * @param {flatbuffers.Builder} builder
1951 * @param {number} mana
1953 MyGame.Example.Monster.addMana = function(builder, mana) {
1954 builder.addFieldInt16(1, mana, 150);
1958 * @param {flatbuffers.Builder} builder
1959 * @param {number} hp
1961 MyGame.Example.Monster.addHp = function(builder, hp) {
1962 builder.addFieldInt16(2, hp, 100);
1966 * @param {flatbuffers.Builder} builder
1967 * @param {flatbuffers.Offset} nameOffset
1969 MyGame.Example.Monster.addName = function(builder, nameOffset) {
1970 builder.addFieldOffset(3, nameOffset, 0);
1974 * @param {flatbuffers.Builder} builder
1975 * @param {flatbuffers.Offset} inventoryOffset
1977 MyGame.Example.Monster.addInventory = function(builder, inventoryOffset) {
1978 builder.addFieldOffset(5, inventoryOffset, 0);
1982 * @param {flatbuffers.Builder} builder
1983 * @param {Array.<number>} data
1984 * @returns {flatbuffers.Offset}
1986 MyGame.Example.Monster.createInventoryVector = function(builder, data) {
1987 builder.startVector(1, data.length, 1);
1988 for (var i = data.length - 1; i >= 0; i--) {
1989 builder.addInt8(data[i]);
1991 return builder.endVector();
1995 * @param {flatbuffers.Builder} builder
1996 * @param {number} numElems
1998 MyGame.Example.Monster.startInventoryVector = function(builder, numElems) {
1999 builder.startVector(1, numElems, 1);
2003 * @param {flatbuffers.Builder} builder
2004 * @param {MyGame.Example.Color} color
2006 MyGame.Example.Monster.addColor = function(builder, color) {
2007 builder.addFieldInt8(6, color, MyGame.Example.Color.Blue);
2011 * @param {flatbuffers.Builder} builder
2012 * @param {MyGame.Example.Any} testType
2014 MyGame.Example.Monster.addTestType = function(builder, testType) {
2015 builder.addFieldInt8(7, testType, MyGame.Example.Any.NONE);
2019 * @param {flatbuffers.Builder} builder
2020 * @param {flatbuffers.Offset} testOffset
2022 MyGame.Example.Monster.addTest = function(builder, testOffset) {
2023 builder.addFieldOffset(8, testOffset, 0);
2027 * @param {flatbuffers.Builder} builder
2028 * @param {flatbuffers.Offset} test4Offset
2030 MyGame.Example.Monster.addTest4 = function(builder, test4Offset) {
2031 builder.addFieldOffset(9, test4Offset, 0);
2035 * @param {flatbuffers.Builder} builder
2036 * @param {number} numElems
2038 MyGame.Example.Monster.startTest4Vector = function(builder, numElems) {
2039 builder.startVector(4, numElems, 2);
2043 * @param {flatbuffers.Builder} builder
2044 * @param {flatbuffers.Offset} testarrayofstringOffset
2046 MyGame.Example.Monster.addTestarrayofstring = function(builder, testarrayofstringOffset) {
2047 builder.addFieldOffset(10, testarrayofstringOffset, 0);
2051 * @param {flatbuffers.Builder} builder
2052 * @param {Array.<flatbuffers.Offset>} data
2053 * @returns {flatbuffers.Offset}
2055 MyGame.Example.Monster.createTestarrayofstringVector = function(builder, data) {
2056 builder.startVector(4, data.length, 4);
2057 for (var i = data.length - 1; i >= 0; i--) {
2058 builder.addOffset(data[i]);
2060 return builder.endVector();
2064 * @param {flatbuffers.Builder} builder
2065 * @param {number} numElems
2067 MyGame.Example.Monster.startTestarrayofstringVector = function(builder, numElems) {
2068 builder.startVector(4, numElems, 4);
2072 * @param {flatbuffers.Builder} builder
2073 * @param {flatbuffers.Offset} testarrayoftablesOffset
2075 MyGame.Example.Monster.addTestarrayoftables = function(builder, testarrayoftablesOffset) {
2076 builder.addFieldOffset(11, testarrayoftablesOffset, 0);
2080 * @param {flatbuffers.Builder} builder
2081 * @param {Array.<flatbuffers.Offset>} data
2082 * @returns {flatbuffers.Offset}
2084 MyGame.Example.Monster.createTestarrayoftablesVector = function(builder, data) {
2085 builder.startVector(4, data.length, 4);
2086 for (var i = data.length - 1; i >= 0; i--) {
2087 builder.addOffset(data[i]);
2089 return builder.endVector();
2093 * @param {flatbuffers.Builder} builder
2094 * @param {number} numElems
2096 MyGame.Example.Monster.startTestarrayoftablesVector = function(builder, numElems) {
2097 builder.startVector(4, numElems, 4);
2101 * @param {flatbuffers.Builder} builder
2102 * @param {flatbuffers.Offset} enemyOffset
2104 MyGame.Example.Monster.addEnemy = function(builder, enemyOffset) {
2105 builder.addFieldOffset(12, enemyOffset, 0);
2109 * @param {flatbuffers.Builder} builder
2110 * @param {flatbuffers.Offset} testnestedflatbufferOffset
2112 MyGame.Example.Monster.addTestnestedflatbuffer = function(builder, testnestedflatbufferOffset) {
2113 builder.addFieldOffset(13, testnestedflatbufferOffset, 0);
2117 * @param {flatbuffers.Builder} builder
2118 * @param {Array.<number>} data
2119 * @returns {flatbuffers.Offset}
2121 MyGame.Example.Monster.createTestnestedflatbufferVector = function(builder, data) {
2122 builder.startVector(1, data.length, 1);
2123 for (var i = data.length - 1; i >= 0; i--) {
2124 builder.addInt8(data[i]);
2126 return builder.endVector();
2130 * @param {flatbuffers.Builder} builder
2131 * @param {number} numElems
2133 MyGame.Example.Monster.startTestnestedflatbufferVector = function(builder, numElems) {
2134 builder.startVector(1, numElems, 1);
2138 * @param {flatbuffers.Builder} builder
2139 * @param {flatbuffers.Offset} testemptyOffset
2141 MyGame.Example.Monster.addTestempty = function(builder, testemptyOffset) {
2142 builder.addFieldOffset(14, testemptyOffset, 0);
2146 * @param {flatbuffers.Builder} builder
2147 * @param {boolean} testbool
2149 MyGame.Example.Monster.addTestbool = function(builder, testbool) {
2150 builder.addFieldInt8(15, +testbool, +false);
2154 * @param {flatbuffers.Builder} builder
2155 * @param {number} testhashs32Fnv1
2157 MyGame.Example.Monster.addTesthashs32Fnv1 = function(builder, testhashs32Fnv1) {
2158 builder.addFieldInt32(16, testhashs32Fnv1, 0);
2162 * @param {flatbuffers.Builder} builder
2163 * @param {number} testhashu32Fnv1
2165 MyGame.Example.Monster.addTesthashu32Fnv1 = function(builder, testhashu32Fnv1) {
2166 builder.addFieldInt32(17, testhashu32Fnv1, 0);
2170 * @param {flatbuffers.Builder} builder
2171 * @param {flatbuffers.Long} testhashs64Fnv1
2173 MyGame.Example.Monster.addTesthashs64Fnv1 = function(builder, testhashs64Fnv1) {
2174 builder.addFieldInt64(18, testhashs64Fnv1, builder.createLong(0, 0));
2178 * @param {flatbuffers.Builder} builder
2179 * @param {flatbuffers.Long} testhashu64Fnv1
2181 MyGame.Example.Monster.addTesthashu64Fnv1 = function(builder, testhashu64Fnv1) {
2182 builder.addFieldInt64(19, testhashu64Fnv1, builder.createLong(0, 0));
2186 * @param {flatbuffers.Builder} builder
2187 * @param {number} testhashs32Fnv1a
2189 MyGame.Example.Monster.addTesthashs32Fnv1a = function(builder, testhashs32Fnv1a) {
2190 builder.addFieldInt32(20, testhashs32Fnv1a, 0);
2194 * @param {flatbuffers.Builder} builder
2195 * @param {number} testhashu32Fnv1a
2197 MyGame.Example.Monster.addTesthashu32Fnv1a = function(builder, testhashu32Fnv1a) {
2198 builder.addFieldInt32(21, testhashu32Fnv1a, 0);
2202 * @param {flatbuffers.Builder} builder
2203 * @param {flatbuffers.Long} testhashs64Fnv1a
2205 MyGame.Example.Monster.addTesthashs64Fnv1a = function(builder, testhashs64Fnv1a) {
2206 builder.addFieldInt64(22, testhashs64Fnv1a, builder.createLong(0, 0));
2210 * @param {flatbuffers.Builder} builder
2211 * @param {flatbuffers.Long} testhashu64Fnv1a
2213 MyGame.Example.Monster.addTesthashu64Fnv1a = function(builder, testhashu64Fnv1a) {
2214 builder.addFieldInt64(23, testhashu64Fnv1a, builder.createLong(0, 0));
2218 * @param {flatbuffers.Builder} builder
2219 * @param {flatbuffers.Offset} testarrayofboolsOffset
2221 MyGame.Example.Monster.addTestarrayofbools = function(builder, testarrayofboolsOffset) {
2222 builder.addFieldOffset(24, testarrayofboolsOffset, 0);
2226 * @param {flatbuffers.Builder} builder
2227 * @param {Array.<boolean>} data
2228 * @returns {flatbuffers.Offset}
2230 MyGame.Example.Monster.createTestarrayofboolsVector = function(builder, data) {
2231 builder.startVector(1, data.length, 1);
2232 for (var i = data.length - 1; i >= 0; i--) {
2233 builder.addInt8(+data[i]);
2235 return builder.endVector();
2239 * @param {flatbuffers.Builder} builder
2240 * @param {number} numElems
2242 MyGame.Example.Monster.startTestarrayofboolsVector = function(builder, numElems) {
2243 builder.startVector(1, numElems, 1);
2247 * @param {flatbuffers.Builder} builder
2248 * @param {number} testf
2250 MyGame.Example.Monster.addTestf = function(builder, testf) {
2251 builder.addFieldFloat32(25, testf, 3.14159);
2255 * @param {flatbuffers.Builder} builder
2256 * @param {number} testf2
2258 MyGame.Example.Monster.addTestf2 = function(builder, testf2) {
2259 builder.addFieldFloat32(26, testf2, 3.0);
2263 * @param {flatbuffers.Builder} builder
2264 * @param {number} testf3
2266 MyGame.Example.Monster.addTestf3 = function(builder, testf3) {
2267 builder.addFieldFloat32(27, testf3, 0.0);
2271 * @param {flatbuffers.Builder} builder
2272 * @param {flatbuffers.Offset} testarrayofstring2Offset
2274 MyGame.Example.Monster.addTestarrayofstring2 = function(builder, testarrayofstring2Offset) {
2275 builder.addFieldOffset(28, testarrayofstring2Offset, 0);
2279 * @param {flatbuffers.Builder} builder
2280 * @param {Array.<flatbuffers.Offset>} data
2281 * @returns {flatbuffers.Offset}
2283 MyGame.Example.Monster.createTestarrayofstring2Vector = function(builder, data) {
2284 builder.startVector(4, data.length, 4);
2285 for (var i = data.length - 1; i >= 0; i--) {
2286 builder.addOffset(data[i]);
2288 return builder.endVector();
2292 * @param {flatbuffers.Builder} builder
2293 * @param {number} numElems
2295 MyGame.Example.Monster.startTestarrayofstring2Vector = function(builder, numElems) {
2296 builder.startVector(4, numElems, 4);
2300 * @param {flatbuffers.Builder} builder
2301 * @param {flatbuffers.Offset} testarrayofsortedstructOffset
2303 MyGame.Example.Monster.addTestarrayofsortedstruct = function(builder, testarrayofsortedstructOffset) {
2304 builder.addFieldOffset(29, testarrayofsortedstructOffset, 0);
2308 * @param {flatbuffers.Builder} builder
2309 * @param {number} numElems
2311 MyGame.Example.Monster.startTestarrayofsortedstructVector = function(builder, numElems) {
2312 builder.startVector(8, numElems, 4);
2316 * @param {flatbuffers.Builder} builder
2317 * @param {flatbuffers.Offset} flexOffset
2319 MyGame.Example.Monster.addFlex = function(builder, flexOffset) {
2320 builder.addFieldOffset(30, flexOffset, 0);
2324 * @param {flatbuffers.Builder} builder
2325 * @param {Array.<number>} data
2326 * @returns {flatbuffers.Offset}
2328 MyGame.Example.Monster.createFlexVector = function(builder, data) {
2329 builder.startVector(1, data.length, 1);
2330 for (var i = data.length - 1; i >= 0; i--) {
2331 builder.addInt8(data[i]);
2333 return builder.endVector();
2337 * @param {flatbuffers.Builder} builder
2338 * @param {number} numElems
2340 MyGame.Example.Monster.startFlexVector = function(builder, numElems) {
2341 builder.startVector(1, numElems, 1);
2345 * @param {flatbuffers.Builder} builder
2346 * @param {flatbuffers.Offset} test5Offset
2348 MyGame.Example.Monster.addTest5 = function(builder, test5Offset) {
2349 builder.addFieldOffset(31, test5Offset, 0);
2353 * @param {flatbuffers.Builder} builder
2354 * @param {number} numElems
2356 MyGame.Example.Monster.startTest5Vector = function(builder, numElems) {
2357 builder.startVector(4, numElems, 2);
2361 * @param {flatbuffers.Builder} builder
2362 * @param {flatbuffers.Offset} vectorOfLongsOffset
2364 MyGame.Example.Monster.addVectorOfLongs = function(builder, vectorOfLongsOffset) {
2365 builder.addFieldOffset(32, vectorOfLongsOffset, 0);
2369 * @param {flatbuffers.Builder} builder
2370 * @param {Array.<flatbuffers.Long>} data
2371 * @returns {flatbuffers.Offset}
2373 MyGame.Example.Monster.createVectorOfLongsVector = function(builder, data) {
2374 builder.startVector(8, data.length, 8);
2375 for (var i = data.length - 1; i >= 0; i--) {
2376 builder.addInt64(data[i]);
2378 return builder.endVector();
2382 * @param {flatbuffers.Builder} builder
2383 * @param {number} numElems
2385 MyGame.Example.Monster.startVectorOfLongsVector = function(builder, numElems) {
2386 builder.startVector(8, numElems, 8);
2390 * @param {flatbuffers.Builder} builder
2391 * @param {flatbuffers.Offset} vectorOfDoublesOffset
2393 MyGame.Example.Monster.addVectorOfDoubles = function(builder, vectorOfDoublesOffset) {
2394 builder.addFieldOffset(33, vectorOfDoublesOffset, 0);
2398 * @param {flatbuffers.Builder} builder
2399 * @param {Array.<number>} data
2400 * @returns {flatbuffers.Offset}
2402 MyGame.Example.Monster.createVectorOfDoublesVector = function(builder, data) {
2403 builder.startVector(8, data.length, 8);
2404 for (var i = data.length - 1; i >= 0; i--) {
2405 builder.addFloat64(data[i]);
2407 return builder.endVector();
2411 * @param {flatbuffers.Builder} builder
2412 * @param {number} numElems
2414 MyGame.Example.Monster.startVectorOfDoublesVector = function(builder, numElems) {
2415 builder.startVector(8, numElems, 8);
2419 * @param {flatbuffers.Builder} builder
2420 * @param {flatbuffers.Offset} parentNamespaceTestOffset
2422 MyGame.Example.Monster.addParentNamespaceTest = function(builder, parentNamespaceTestOffset) {
2423 builder.addFieldOffset(34, parentNamespaceTestOffset, 0);
2427 * @param {flatbuffers.Builder} builder
2428 * @param {flatbuffers.Offset} vectorOfReferrablesOffset
2430 MyGame.Example.Monster.addVectorOfReferrables = function(builder, vectorOfReferrablesOffset) {
2431 builder.addFieldOffset(35, vectorOfReferrablesOffset, 0);
2435 * @param {flatbuffers.Builder} builder
2436 * @param {Array.<flatbuffers.Offset>} data
2437 * @returns {flatbuffers.Offset}
2439 MyGame.Example.Monster.createVectorOfReferrablesVector = function(builder, data) {
2440 builder.startVector(4, data.length, 4);
2441 for (var i = data.length - 1; i >= 0; i--) {
2442 builder.addOffset(data[i]);
2444 return builder.endVector();
2448 * @param {flatbuffers.Builder} builder
2449 * @param {number} numElems
2451 MyGame.Example.Monster.startVectorOfReferrablesVector = function(builder, numElems) {
2452 builder.startVector(4, numElems, 4);
2456 * @param {flatbuffers.Builder} builder
2457 * @param {flatbuffers.Long} singleWeakReference
2459 MyGame.Example.Monster.addSingleWeakReference = function(builder, singleWeakReference) {
2460 builder.addFieldInt64(36, singleWeakReference, builder.createLong(0, 0));
2464 * @param {flatbuffers.Builder} builder
2465 * @param {flatbuffers.Offset} vectorOfWeakReferencesOffset
2467 MyGame.Example.Monster.addVectorOfWeakReferences = function(builder, vectorOfWeakReferencesOffset) {
2468 builder.addFieldOffset(37, vectorOfWeakReferencesOffset, 0);
2472 * @param {flatbuffers.Builder} builder
2473 * @param {Array.<flatbuffers.Long>} data
2474 * @returns {flatbuffers.Offset}
2476 MyGame.Example.Monster.createVectorOfWeakReferencesVector = function(builder, data) {
2477 builder.startVector(8, data.length, 8);
2478 for (var i = data.length - 1; i >= 0; i--) {
2479 builder.addInt64(data[i]);
2481 return builder.endVector();
2485 * @param {flatbuffers.Builder} builder
2486 * @param {number} numElems
2488 MyGame.Example.Monster.startVectorOfWeakReferencesVector = function(builder, numElems) {
2489 builder.startVector(8, numElems, 8);
2493 * @param {flatbuffers.Builder} builder
2494 * @param {flatbuffers.Offset} vectorOfStrongReferrablesOffset
2496 MyGame.Example.Monster.addVectorOfStrongReferrables = function(builder, vectorOfStrongReferrablesOffset) {
2497 builder.addFieldOffset(38, vectorOfStrongReferrablesOffset, 0);
2501 * @param {flatbuffers.Builder} builder
2502 * @param {Array.<flatbuffers.Offset>} data
2503 * @returns {flatbuffers.Offset}
2505 MyGame.Example.Monster.createVectorOfStrongReferrablesVector = function(builder, data) {
2506 builder.startVector(4, data.length, 4);
2507 for (var i = data.length - 1; i >= 0; i--) {
2508 builder.addOffset(data[i]);
2510 return builder.endVector();
2514 * @param {flatbuffers.Builder} builder
2515 * @param {number} numElems
2517 MyGame.Example.Monster.startVectorOfStrongReferrablesVector = function(builder, numElems) {
2518 builder.startVector(4, numElems, 4);
2522 * @param {flatbuffers.Builder} builder
2523 * @param {flatbuffers.Long} coOwningReference
2525 MyGame.Example.Monster.addCoOwningReference = function(builder, coOwningReference) {
2526 builder.addFieldInt64(39, coOwningReference, builder.createLong(0, 0));
2530 * @param {flatbuffers.Builder} builder
2531 * @param {flatbuffers.Offset} vectorOfCoOwningReferencesOffset
2533 MyGame.Example.Monster.addVectorOfCoOwningReferences = function(builder, vectorOfCoOwningReferencesOffset) {
2534 builder.addFieldOffset(40, vectorOfCoOwningReferencesOffset, 0);
2538 * @param {flatbuffers.Builder} builder
2539 * @param {Array.<flatbuffers.Long>} data
2540 * @returns {flatbuffers.Offset}
2542 MyGame.Example.Monster.createVectorOfCoOwningReferencesVector = function(builder, data) {
2543 builder.startVector(8, data.length, 8);
2544 for (var i = data.length - 1; i >= 0; i--) {
2545 builder.addInt64(data[i]);
2547 return builder.endVector();
2551 * @param {flatbuffers.Builder} builder
2552 * @param {number} numElems
2554 MyGame.Example.Monster.startVectorOfCoOwningReferencesVector = function(builder, numElems) {
2555 builder.startVector(8, numElems, 8);
2559 * @param {flatbuffers.Builder} builder
2560 * @param {flatbuffers.Long} nonOwningReference
2562 MyGame.Example.Monster.addNonOwningReference = function(builder, nonOwningReference) {
2563 builder.addFieldInt64(41, nonOwningReference, builder.createLong(0, 0));
2567 * @param {flatbuffers.Builder} builder
2568 * @param {flatbuffers.Offset} vectorOfNonOwningReferencesOffset
2570 MyGame.Example.Monster.addVectorOfNonOwningReferences = function(builder, vectorOfNonOwningReferencesOffset) {
2571 builder.addFieldOffset(42, vectorOfNonOwningReferencesOffset, 0);
2575 * @param {flatbuffers.Builder} builder
2576 * @param {Array.<flatbuffers.Long>} data
2577 * @returns {flatbuffers.Offset}
2579 MyGame.Example.Monster.createVectorOfNonOwningReferencesVector = function(builder, data) {
2580 builder.startVector(8, data.length, 8);
2581 for (var i = data.length - 1; i >= 0; i--) {
2582 builder.addInt64(data[i]);
2584 return builder.endVector();
2588 * @param {flatbuffers.Builder} builder
2589 * @param {number} numElems
2591 MyGame.Example.Monster.startVectorOfNonOwningReferencesVector = function(builder, numElems) {
2592 builder.startVector(8, numElems, 8);
2596 * @param {flatbuffers.Builder} builder
2597 * @param {MyGame.Example.AnyUniqueAliases} anyUniqueType
2599 MyGame.Example.Monster.addAnyUniqueType = function(builder, anyUniqueType) {
2600 builder.addFieldInt8(43, anyUniqueType, MyGame.Example.AnyUniqueAliases.NONE);
2604 * @param {flatbuffers.Builder} builder
2605 * @param {flatbuffers.Offset} anyUniqueOffset
2607 MyGame.Example.Monster.addAnyUnique = function(builder, anyUniqueOffset) {
2608 builder.addFieldOffset(44, anyUniqueOffset, 0);
2612 * @param {flatbuffers.Builder} builder
2613 * @param {MyGame.Example.AnyAmbiguousAliases} anyAmbiguousType
2615 MyGame.Example.Monster.addAnyAmbiguousType = function(builder, anyAmbiguousType) {
2616 builder.addFieldInt8(45, anyAmbiguousType, MyGame.Example.AnyAmbiguousAliases.NONE);
2620 * @param {flatbuffers.Builder} builder
2621 * @param {flatbuffers.Offset} anyAmbiguousOffset
2623 MyGame.Example.Monster.addAnyAmbiguous = function(builder, anyAmbiguousOffset) {
2624 builder.addFieldOffset(46, anyAmbiguousOffset, 0);
2628 * @param {flatbuffers.Builder} builder
2629 * @param {flatbuffers.Offset} vectorOfEnumsOffset
2631 MyGame.Example.Monster.addVectorOfEnums = function(builder, vectorOfEnumsOffset) {
2632 builder.addFieldOffset(47, vectorOfEnumsOffset, 0);
2636 * @param {flatbuffers.Builder} builder
2637 * @param {Array.<MyGame.Example.Color>} data
2638 * @returns {flatbuffers.Offset}
2640 MyGame.Example.Monster.createVectorOfEnumsVector = function(builder, data) {
2641 builder.startVector(1, data.length, 1);
2642 for (var i = data.length - 1; i >= 0; i--) {
2643 builder.addInt8(data[i]);
2645 return builder.endVector();
2649 * @param {flatbuffers.Builder} builder
2650 * @param {number} numElems
2652 MyGame.Example.Monster.startVectorOfEnumsVector = function(builder, numElems) {
2653 builder.startVector(1, numElems, 1);
2657 * @param {flatbuffers.Builder} builder
2658 * @param {MyGame.Example.Race} signedEnum
2660 MyGame.Example.Monster.addSignedEnum = function(builder, signedEnum) {
2661 builder.addFieldInt8(48, signedEnum, MyGame.Example.Race.None);
2665 * @param {flatbuffers.Builder} builder
2666 * @returns {flatbuffers.Offset}
2668 MyGame.Example.Monster.endMonster = function(builder) {
2669 var offset = builder.endObject();
2670 builder.requiredField(offset, 10); // name
2675 * @param {flatbuffers.Builder} builder
2676 * @param {flatbuffers.Offset} offset
2678 MyGame.Example.Monster.finishMonsterBuffer = function(builder, offset) {
2679 builder.finish(offset, 'MONS');
2683 * @param {flatbuffers.Builder} builder
2684 * @param {flatbuffers.Offset} offset
2686 MyGame.Example.Monster.finishSizePrefixedMonsterBuffer = function(builder, offset) {
2687 builder.finish(offset, 'MONS', true);
2691 * @param {flatbuffers.Builder} builder
2692 * @param {flatbuffers.Offset} posOffset
2693 * @param {number} mana
2694 * @param {number} hp
2695 * @param {flatbuffers.Offset} nameOffset
2696 * @param {flatbuffers.Offset} inventoryOffset
2697 * @param {MyGame.Example.Color} color
2698 * @param {MyGame.Example.Any} testType
2699 * @param {flatbuffers.Offset} testOffset
2700 * @param {flatbuffers.Offset} test4Offset
2701 * @param {flatbuffers.Offset} testarrayofstringOffset
2702 * @param {flatbuffers.Offset} testarrayoftablesOffset
2703 * @param {flatbuffers.Offset} enemyOffset
2704 * @param {flatbuffers.Offset} testnestedflatbufferOffset
2705 * @param {flatbuffers.Offset} testemptyOffset
2706 * @param {boolean} testbool
2707 * @param {number} testhashs32Fnv1
2708 * @param {number} testhashu32Fnv1
2709 * @param {flatbuffers.Long} testhashs64Fnv1
2710 * @param {flatbuffers.Long} testhashu64Fnv1
2711 * @param {number} testhashs32Fnv1a
2712 * @param {number} testhashu32Fnv1a
2713 * @param {flatbuffers.Long} testhashs64Fnv1a
2714 * @param {flatbuffers.Long} testhashu64Fnv1a
2715 * @param {flatbuffers.Offset} testarrayofboolsOffset
2716 * @param {number} testf
2717 * @param {number} testf2
2718 * @param {number} testf3
2719 * @param {flatbuffers.Offset} testarrayofstring2Offset
2720 * @param {flatbuffers.Offset} testarrayofsortedstructOffset
2721 * @param {flatbuffers.Offset} flexOffset
2722 * @param {flatbuffers.Offset} test5Offset
2723 * @param {flatbuffers.Offset} vectorOfLongsOffset
2724 * @param {flatbuffers.Offset} vectorOfDoublesOffset
2725 * @param {flatbuffers.Offset} parentNamespaceTestOffset
2726 * @param {flatbuffers.Offset} vectorOfReferrablesOffset
2727 * @param {flatbuffers.Long} singleWeakReference
2728 * @param {flatbuffers.Offset} vectorOfWeakReferencesOffset
2729 * @param {flatbuffers.Offset} vectorOfStrongReferrablesOffset
2730 * @param {flatbuffers.Long} coOwningReference
2731 * @param {flatbuffers.Offset} vectorOfCoOwningReferencesOffset
2732 * @param {flatbuffers.Long} nonOwningReference
2733 * @param {flatbuffers.Offset} vectorOfNonOwningReferencesOffset
2734 * @param {MyGame.Example.AnyUniqueAliases} anyUniqueType
2735 * @param {flatbuffers.Offset} anyUniqueOffset
2736 * @param {MyGame.Example.AnyAmbiguousAliases} anyAmbiguousType
2737 * @param {flatbuffers.Offset} anyAmbiguousOffset
2738 * @param {flatbuffers.Offset} vectorOfEnumsOffset
2739 * @param {MyGame.Example.Race} signedEnum
2740 * @returns {flatbuffers.Offset}
2742 MyGame.Example.Monster.createMonster = function(builder, posOffset, mana, hp, nameOffset, inventoryOffset, color, testType, testOffset, test4Offset, testarrayofstringOffset, testarrayoftablesOffset, enemyOffset, testnestedflatbufferOffset, testemptyOffset, testbool, testhashs32Fnv1, testhashu32Fnv1, testhashs64Fnv1, testhashu64Fnv1, testhashs32Fnv1a, testhashu32Fnv1a, testhashs64Fnv1a, testhashu64Fnv1a, testarrayofboolsOffset, testf, testf2, testf3, testarrayofstring2Offset, testarrayofsortedstructOffset, flexOffset, test5Offset, vectorOfLongsOffset, vectorOfDoublesOffset, parentNamespaceTestOffset, vectorOfReferrablesOffset, singleWeakReference, vectorOfWeakReferencesOffset, vectorOfStrongReferrablesOffset, coOwningReference, vectorOfCoOwningReferencesOffset, nonOwningReference, vectorOfNonOwningReferencesOffset, anyUniqueType, anyUniqueOffset, anyAmbiguousType, anyAmbiguousOffset, vectorOfEnumsOffset, signedEnum) {
2743 MyGame.Example.Monster.startMonster(builder);
2744 MyGame.Example.Monster.addPos(builder, posOffset);
2745 MyGame.Example.Monster.addMana(builder, mana);
2746 MyGame.Example.Monster.addHp(builder, hp);
2747 MyGame.Example.Monster.addName(builder, nameOffset);
2748 MyGame.Example.Monster.addInventory(builder, inventoryOffset);
2749 MyGame.Example.Monster.addColor(builder, color);
2750 MyGame.Example.Monster.addTestType(builder, testType);
2751 MyGame.Example.Monster.addTest(builder, testOffset);
2752 MyGame.Example.Monster.addTest4(builder, test4Offset);
2753 MyGame.Example.Monster.addTestarrayofstring(builder, testarrayofstringOffset);
2754 MyGame.Example.Monster.addTestarrayoftables(builder, testarrayoftablesOffset);
2755 MyGame.Example.Monster.addEnemy(builder, enemyOffset);
2756 MyGame.Example.Monster.addTestnestedflatbuffer(builder, testnestedflatbufferOffset);
2757 MyGame.Example.Monster.addTestempty(builder, testemptyOffset);
2758 MyGame.Example.Monster.addTestbool(builder, testbool);
2759 MyGame.Example.Monster.addTesthashs32Fnv1(builder, testhashs32Fnv1);
2760 MyGame.Example.Monster.addTesthashu32Fnv1(builder, testhashu32Fnv1);
2761 MyGame.Example.Monster.addTesthashs64Fnv1(builder, testhashs64Fnv1);
2762 MyGame.Example.Monster.addTesthashu64Fnv1(builder, testhashu64Fnv1);
2763 MyGame.Example.Monster.addTesthashs32Fnv1a(builder, testhashs32Fnv1a);
2764 MyGame.Example.Monster.addTesthashu32Fnv1a(builder, testhashu32Fnv1a);
2765 MyGame.Example.Monster.addTesthashs64Fnv1a(builder, testhashs64Fnv1a);
2766 MyGame.Example.Monster.addTesthashu64Fnv1a(builder, testhashu64Fnv1a);
2767 MyGame.Example.Monster.addTestarrayofbools(builder, testarrayofboolsOffset);
2768 MyGame.Example.Monster.addTestf(builder, testf);
2769 MyGame.Example.Monster.addTestf2(builder, testf2);
2770 MyGame.Example.Monster.addTestf3(builder, testf3);
2771 MyGame.Example.Monster.addTestarrayofstring2(builder, testarrayofstring2Offset);
2772 MyGame.Example.Monster.addTestarrayofsortedstruct(builder, testarrayofsortedstructOffset);
2773 MyGame.Example.Monster.addFlex(builder, flexOffset);
2774 MyGame.Example.Monster.addTest5(builder, test5Offset);
2775 MyGame.Example.Monster.addVectorOfLongs(builder, vectorOfLongsOffset);
2776 MyGame.Example.Monster.addVectorOfDoubles(builder, vectorOfDoublesOffset);
2777 MyGame.Example.Monster.addParentNamespaceTest(builder, parentNamespaceTestOffset);
2778 MyGame.Example.Monster.addVectorOfReferrables(builder, vectorOfReferrablesOffset);
2779 MyGame.Example.Monster.addSingleWeakReference(builder, singleWeakReference);
2780 MyGame.Example.Monster.addVectorOfWeakReferences(builder, vectorOfWeakReferencesOffset);
2781 MyGame.Example.Monster.addVectorOfStrongReferrables(builder, vectorOfStrongReferrablesOffset);
2782 MyGame.Example.Monster.addCoOwningReference(builder, coOwningReference);
2783 MyGame.Example.Monster.addVectorOfCoOwningReferences(builder, vectorOfCoOwningReferencesOffset);
2784 MyGame.Example.Monster.addNonOwningReference(builder, nonOwningReference);
2785 MyGame.Example.Monster.addVectorOfNonOwningReferences(builder, vectorOfNonOwningReferencesOffset);
2786 MyGame.Example.Monster.addAnyUniqueType(builder, anyUniqueType);
2787 MyGame.Example.Monster.addAnyUnique(builder, anyUniqueOffset);
2788 MyGame.Example.Monster.addAnyAmbiguousType(builder, anyAmbiguousType);
2789 MyGame.Example.Monster.addAnyAmbiguous(builder, anyAmbiguousOffset);
2790 MyGame.Example.Monster.addVectorOfEnums(builder, vectorOfEnumsOffset);
2791 MyGame.Example.Monster.addSignedEnum(builder, signedEnum);
2792 return MyGame.Example.Monster.endMonster(builder);
2798 MyGame.Example.TypeAliases = function() {
2800 * @type {flatbuffers.ByteBuffer}
2812 * @param {flatbuffers.ByteBuffer} bb
2813 * @returns {MyGame.Example.TypeAliases}
2815 MyGame.Example.TypeAliases.prototype.__init = function(i, bb) {
2822 * @param {flatbuffers.ByteBuffer} bb
2823 * @param {MyGame.Example.TypeAliases=} obj
2824 * @returns {MyGame.Example.TypeAliases}
2826 MyGame.Example.TypeAliases.getRootAsTypeAliases = function(bb, obj) {
2827 return (obj || new MyGame.Example.TypeAliases).__init(bb.readInt32(bb.position()) + bb.position(), bb);
2831 * @param {flatbuffers.ByteBuffer} bb
2832 * @param {MyGame.Example.TypeAliases=} obj
2833 * @returns {MyGame.Example.TypeAliases}
2835 MyGame.Example.TypeAliases.getSizePrefixedRootAsTypeAliases = function(bb, obj) {
2836 return (obj || new MyGame.Example.TypeAliases).__init(bb.readInt32(bb.position()) + bb.position(), bb);
2842 MyGame.Example.TypeAliases.prototype.i8 = function() {
2843 var offset = this.bb.__offset(this.bb_pos, 4);
2844 return offset ? this.bb.readInt8(this.bb_pos + offset) : 0;
2848 * @param {number} value
2849 * @returns {boolean}
2851 MyGame.Example.TypeAliases.prototype.mutate_i8 = function(value) {
2852 var offset = this.bb.__offset(this.bb_pos, 4);
2858 this.bb.writeInt8(this.bb_pos + offset, value);
2865 MyGame.Example.TypeAliases.prototype.u8 = function() {
2866 var offset = this.bb.__offset(this.bb_pos, 6);
2867 return offset ? this.bb.readUint8(this.bb_pos + offset) : 0;
2871 * @param {number} value
2872 * @returns {boolean}
2874 MyGame.Example.TypeAliases.prototype.mutate_u8 = function(value) {
2875 var offset = this.bb.__offset(this.bb_pos, 6);
2881 this.bb.writeUint8(this.bb_pos + offset, value);
2888 MyGame.Example.TypeAliases.prototype.i16 = function() {
2889 var offset = this.bb.__offset(this.bb_pos, 8);
2890 return offset ? this.bb.readInt16(this.bb_pos + offset) : 0;
2894 * @param {number} value
2895 * @returns {boolean}
2897 MyGame.Example.TypeAliases.prototype.mutate_i16 = function(value) {
2898 var offset = this.bb.__offset(this.bb_pos, 8);
2904 this.bb.writeInt16(this.bb_pos + offset, value);
2911 MyGame.Example.TypeAliases.prototype.u16 = function() {
2912 var offset = this.bb.__offset(this.bb_pos, 10);
2913 return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
2917 * @param {number} value
2918 * @returns {boolean}
2920 MyGame.Example.TypeAliases.prototype.mutate_u16 = function(value) {
2921 var offset = this.bb.__offset(this.bb_pos, 10);
2927 this.bb.writeUint16(this.bb_pos + offset, value);
2934 MyGame.Example.TypeAliases.prototype.i32 = function() {
2935 var offset = this.bb.__offset(this.bb_pos, 12);
2936 return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
2940 * @param {number} value
2941 * @returns {boolean}
2943 MyGame.Example.TypeAliases.prototype.mutate_i32 = function(value) {
2944 var offset = this.bb.__offset(this.bb_pos, 12);
2950 this.bb.writeInt32(this.bb_pos + offset, value);
2957 MyGame.Example.TypeAliases.prototype.u32 = function() {
2958 var offset = this.bb.__offset(this.bb_pos, 14);
2959 return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
2963 * @param {number} value
2964 * @returns {boolean}
2966 MyGame.Example.TypeAliases.prototype.mutate_u32 = function(value) {
2967 var offset = this.bb.__offset(this.bb_pos, 14);
2973 this.bb.writeUint32(this.bb_pos + offset, value);
2978 * @returns {flatbuffers.Long}
2980 MyGame.Example.TypeAliases.prototype.i64 = function() {
2981 var offset = this.bb.__offset(this.bb_pos, 16);
2982 return offset ? this.bb.readInt64(this.bb_pos + offset) : this.bb.createLong(0, 0);
2986 * @param {flatbuffers.Long} value
2987 * @returns {boolean}
2989 MyGame.Example.TypeAliases.prototype.mutate_i64 = function(value) {
2990 var offset = this.bb.__offset(this.bb_pos, 16);
2996 this.bb.writeInt64(this.bb_pos + offset, value);
3001 * @returns {flatbuffers.Long}
3003 MyGame.Example.TypeAliases.prototype.u64 = function() {
3004 var offset = this.bb.__offset(this.bb_pos, 18);
3005 return offset ? this.bb.readUint64(this.bb_pos + offset) : this.bb.createLong(0, 0);
3009 * @param {flatbuffers.Long} value
3010 * @returns {boolean}
3012 MyGame.Example.TypeAliases.prototype.mutate_u64 = function(value) {
3013 var offset = this.bb.__offset(this.bb_pos, 18);
3019 this.bb.writeUint64(this.bb_pos + offset, value);
3026 MyGame.Example.TypeAliases.prototype.f32 = function() {
3027 var offset = this.bb.__offset(this.bb_pos, 20);
3028 return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0.0;
3032 * @param {number} value
3033 * @returns {boolean}
3035 MyGame.Example.TypeAliases.prototype.mutate_f32 = function(value) {
3036 var offset = this.bb.__offset(this.bb_pos, 20);
3042 this.bb.writeFloat32(this.bb_pos + offset, value);
3049 MyGame.Example.TypeAliases.prototype.f64 = function() {
3050 var offset = this.bb.__offset(this.bb_pos, 22);
3051 return offset ? this.bb.readFloat64(this.bb_pos + offset) : 0.0;
3055 * @param {number} value
3056 * @returns {boolean}
3058 MyGame.Example.TypeAliases.prototype.mutate_f64 = function(value) {
3059 var offset = this.bb.__offset(this.bb_pos, 22);
3065 this.bb.writeFloat64(this.bb_pos + offset, value);
3070 * @param {number} index
3073 MyGame.Example.TypeAliases.prototype.v8 = function(index) {
3074 var offset = this.bb.__offset(this.bb_pos, 24);
3075 return offset ? this.bb.readInt8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
3081 MyGame.Example.TypeAliases.prototype.v8Length = function() {
3082 var offset = this.bb.__offset(this.bb_pos, 24);
3083 return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
3087 * @returns {Int8Array}
3089 MyGame.Example.TypeAliases.prototype.v8Array = function() {
3090 var offset = this.bb.__offset(this.bb_pos, 24);
3091 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;
3095 * @param {number} index
3098 MyGame.Example.TypeAliases.prototype.vf64 = function(index) {
3099 var offset = this.bb.__offset(this.bb_pos, 26);
3100 return offset ? this.bb.readFloat64(this.bb.__vector(this.bb_pos + offset) + index * 8) : 0;
3106 MyGame.Example.TypeAliases.prototype.vf64Length = function() {
3107 var offset = this.bb.__offset(this.bb_pos, 26);
3108 return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
3112 * @returns {Float64Array}
3114 MyGame.Example.TypeAliases.prototype.vf64Array = function() {
3115 var offset = this.bb.__offset(this.bb_pos, 26);
3116 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;
3120 * @param {flatbuffers.Builder} builder
3122 MyGame.Example.TypeAliases.startTypeAliases = function(builder) {
3123 builder.startObject(12);
3127 * @param {flatbuffers.Builder} builder
3128 * @param {number} i8
3130 MyGame.Example.TypeAliases.addI8 = function(builder, i8) {
3131 builder.addFieldInt8(0, i8, 0);
3135 * @param {flatbuffers.Builder} builder
3136 * @param {number} u8
3138 MyGame.Example.TypeAliases.addU8 = function(builder, u8) {
3139 builder.addFieldInt8(1, u8, 0);
3143 * @param {flatbuffers.Builder} builder
3144 * @param {number} i16
3146 MyGame.Example.TypeAliases.addI16 = function(builder, i16) {
3147 builder.addFieldInt16(2, i16, 0);
3151 * @param {flatbuffers.Builder} builder
3152 * @param {number} u16
3154 MyGame.Example.TypeAliases.addU16 = function(builder, u16) {
3155 builder.addFieldInt16(3, u16, 0);
3159 * @param {flatbuffers.Builder} builder
3160 * @param {number} i32
3162 MyGame.Example.TypeAliases.addI32 = function(builder, i32) {
3163 builder.addFieldInt32(4, i32, 0);
3167 * @param {flatbuffers.Builder} builder
3168 * @param {number} u32
3170 MyGame.Example.TypeAliases.addU32 = function(builder, u32) {
3171 builder.addFieldInt32(5, u32, 0);
3175 * @param {flatbuffers.Builder} builder
3176 * @param {flatbuffers.Long} i64
3178 MyGame.Example.TypeAliases.addI64 = function(builder, i64) {
3179 builder.addFieldInt64(6, i64, builder.createLong(0, 0));
3183 * @param {flatbuffers.Builder} builder
3184 * @param {flatbuffers.Long} u64
3186 MyGame.Example.TypeAliases.addU64 = function(builder, u64) {
3187 builder.addFieldInt64(7, u64, builder.createLong(0, 0));
3191 * @param {flatbuffers.Builder} builder
3192 * @param {number} f32
3194 MyGame.Example.TypeAliases.addF32 = function(builder, f32) {
3195 builder.addFieldFloat32(8, f32, 0.0);
3199 * @param {flatbuffers.Builder} builder
3200 * @param {number} f64
3202 MyGame.Example.TypeAliases.addF64 = function(builder, f64) {
3203 builder.addFieldFloat64(9, f64, 0.0);
3207 * @param {flatbuffers.Builder} builder
3208 * @param {flatbuffers.Offset} v8Offset
3210 MyGame.Example.TypeAliases.addV8 = function(builder, v8Offset) {
3211 builder.addFieldOffset(10, v8Offset, 0);
3215 * @param {flatbuffers.Builder} builder
3216 * @param {Array.<number>} data
3217 * @returns {flatbuffers.Offset}
3219 MyGame.Example.TypeAliases.createV8Vector = function(builder, data) {
3220 builder.startVector(1, data.length, 1);
3221 for (var i = data.length - 1; i >= 0; i--) {
3222 builder.addInt8(data[i]);
3224 return builder.endVector();
3228 * @param {flatbuffers.Builder} builder
3229 * @param {number} numElems
3231 MyGame.Example.TypeAliases.startV8Vector = function(builder, numElems) {
3232 builder.startVector(1, numElems, 1);
3236 * @param {flatbuffers.Builder} builder
3237 * @param {flatbuffers.Offset} vf64Offset
3239 MyGame.Example.TypeAliases.addVf64 = function(builder, vf64Offset) {
3240 builder.addFieldOffset(11, vf64Offset, 0);
3244 * @param {flatbuffers.Builder} builder
3245 * @param {Array.<number>} data
3246 * @returns {flatbuffers.Offset}
3248 MyGame.Example.TypeAliases.createVf64Vector = function(builder, data) {
3249 builder.startVector(8, data.length, 8);
3250 for (var i = data.length - 1; i >= 0; i--) {
3251 builder.addFloat64(data[i]);
3253 return builder.endVector();
3257 * @param {flatbuffers.Builder} builder
3258 * @param {number} numElems
3260 MyGame.Example.TypeAliases.startVf64Vector = function(builder, numElems) {
3261 builder.startVector(8, numElems, 8);
3265 * @param {flatbuffers.Builder} builder
3266 * @returns {flatbuffers.Offset}
3268 MyGame.Example.TypeAliases.endTypeAliases = function(builder) {
3269 var offset = builder.endObject();
3274 * @param {flatbuffers.Builder} builder
3275 * @param {number} i8
3276 * @param {number} u8
3277 * @param {number} i16
3278 * @param {number} u16
3279 * @param {number} i32
3280 * @param {number} u32
3281 * @param {flatbuffers.Long} i64
3282 * @param {flatbuffers.Long} u64
3283 * @param {number} f32
3284 * @param {number} f64
3285 * @param {flatbuffers.Offset} v8Offset
3286 * @param {flatbuffers.Offset} vf64Offset
3287 * @returns {flatbuffers.Offset}
3289 MyGame.Example.TypeAliases.createTypeAliases = function(builder, i8, u8, i16, u16, i32, u32, i64, u64, f32, f64, v8Offset, vf64Offset) {
3290 MyGame.Example.TypeAliases.startTypeAliases(builder);
3291 MyGame.Example.TypeAliases.addI8(builder, i8);
3292 MyGame.Example.TypeAliases.addU8(builder, u8);
3293 MyGame.Example.TypeAliases.addI16(builder, i16);
3294 MyGame.Example.TypeAliases.addU16(builder, u16);
3295 MyGame.Example.TypeAliases.addI32(builder, i32);
3296 MyGame.Example.TypeAliases.addU32(builder, u32);
3297 MyGame.Example.TypeAliases.addI64(builder, i64);
3298 MyGame.Example.TypeAliases.addU64(builder, u64);
3299 MyGame.Example.TypeAliases.addF32(builder, f32);
3300 MyGame.Example.TypeAliases.addF64(builder, f64);
3301 MyGame.Example.TypeAliases.addV8(builder, v8Offset);
3302 MyGame.Example.TypeAliases.addVf64(builder, vf64Offset);
3303 return MyGame.Example.TypeAliases.endTypeAliases(builder);
3306 // Exports for Node.js and RequireJS
3307 this.MyGame = MyGame;