Squashed 'third_party/flatbuffers/' changes from e5f331db9..bc44fad35
bc44fad35 UnPackTo disable merge by default (#7527)
4fca4dc60 [TS/JS] Move TS tests to dedicated folder and deps upgrade (#7508)
036032373 Bump junit from 4.13 to 4.13.1 in /java (#7526)
89dfb43f3 Replace `bash JavaTest.sh` with `mvn test` (#7500)
c49aff4b6 enabled cpp17 tests in CI (#7524)
56e60223c prevent force_align attribute on enums (#7523)
89b1f5aa1 remove travis config (#7522)
b90159823 [Java][Flexbuffers] Add API to add nullables into the buffer. (#7521)
8cdc6a288 Install BuildFlatBuffers.cmake (#7519)
a67e35aff Moves all of the swift test code into tests/swift (#7509)
f124e41ae Updated Readme
4c954181c [Java][FlexBuffers] throwing exception for untyped fixed vectors (#7507)
7f7547737 [Android] Remove maven dependency of flatbuffers and use source folder (#7503)
a79d61ea8 Fixes issue with cocoapods failing to be published because of docc (#7505)
d465b39c3 [CMake]: fix breaking find_package change (#7499) (#7502)
c5a609dc2 [C#] Prepares for official Nuget release (#7496)
5634dc3d0 [ISSUE-6268] returns NaN insteadof nan (#7498)
37e37b8ca Updates cocoapods version (#7497)
8fd4534fb update android multidex setting (#7495)
d5427da52 Disable Android Build (#7494)
06c5c7ed0 FlatBuffers Version 2.0.8 (#7492)
b190ce11b Verifier Refinements (#7490)
bf5d23230 Namer applied to Typescript generator (#7488)
ce382d6dd [TS/JS] Add rollup and config to generate iife flatbuffers bundle (#7449)
41d9add7e C++: Add option to skip verifying nested flatbuffers (#7489)
6a8742754 [C++] support native_inline attribute for vector of tables (#7479)
694add668 Refactor test.cpp (#7487)
7edf8c908 Update scorecard to 1.1.2
b86387442 Fix typos (#7483)
e2eb5ee67 Include <array> head in stl_emulation.h (#7480)
994502b6d Version number in file package.json updated to 2.0.7 (#7476)
fa41e8367 [C++] Fixed crash when copying table with empty shared strings (#7477)
799cc8f7b Use type traits for specialization (#7475)
b7eb44147 Disable RTTI and rework use in idl_gen_ts.cpp (#7474)
8d01c5859 CMake project version detection made more robust (#7473)
237e8b71f Moved compiler warnings around (#7471)
eeb8fd60d Include builder.addOffset for vector of structs (#7470)
fef2ffc4d Use schema include name for keep-prefix (#7469)
8367664f1 Flatbuffers Version 2.0.7 (#7462)
d6f06c33f Reworked keep prefix (#7456)
627e8bf36 update grpc version (#7457)
883c42b7d disabling unpackto optimization (#7459)
7aae0af30 Remove old GRPC bash script and convert to python3 (#7454)
b057aa917 Grouped anonymous namespaces together, (#7455)
f1b26ff7f Change to GetTypeName (#7453)
9610a666b Generate SLSA signatures for Released zip files (#7450)
1e0f75a64 [WIP] speedup (#7452)
82b75407a Wrap types in namespace for --ts-flat-files and --gen-all (#7451)
f7c511957 Audit and fixups for GCC and Clang (#7212)
a66de58af Partial support for --ts-flat-files and --gen-all (#7446)
a3508f36d [Kotlin] Make sure namespace path exist for code generation (#7357)
137fec716 Stop using __has_trivial_copy on recent clang versions. (#7443)
214125e41 [C#] Rework how sorted vectors are looked up (#7441)
44a7dc999 Define minimum buffer size (#7440)
3cc2daa78 make_span overloads for pointer to vector (#7374) (#7435)
fa1174aa7 [TypeScript] Fix namespaceless schema generation (#7432)
83d4e2a10 Add checks to verifier (#7438)
8a09f3fb0 Fix FlexBuffers JS/TS bug https://github.com/google/flatbuffers/issues/6934 (#7434)
9dbe819ef Add flatc python tests to CI (#7437)
67c414958 Update TypeScriptTest.py to work better cross platform (#7436)
8b8c7dbdf Update gitingore to reflect name change (#7431)
2ee20a5f3 Remove auto including locale functions (#7430)
4be605604 [C++] Set StructDef::has_key property when deserializing from binary schema (#7386) (#7428)
fc5d86f1e [C++] Make template parameter in stl_emulation.h more explicit to avoid conflicts with cpprestsdk U macro (#7424)
9dce287ad Issue#6959 :Updated Automatically generated rust files. (#7425)
7798be3bb avoid zero-as-null-pointer warning (#7423)
966362e07 [C++] Vector of Tables equality (#7415)
a89c279ed [golang] Perform keyword escaping after case conversion (#7421)
a212b3c03 Turn of fail fast for C++ CI
9230f600d Remove stringop-overflow from error (#7422)
c79362156 [golang] Add support for text parsing with json struct tags (#7353)
ee2ced236 Moved TypeScriptTests to python script (#7411)
468c00a3f Rebased: grpc/compiler: Respect filename suffix and extension during code generation (#7414)
47c757f71 Add tests for flatc (#7405)
9a5ff8900 Add FLATBUFFERS_STRICT_MODE (#7408)
950444a34 [TS] Use TextEncoder and TextDecoder (#7400)
30d76198c Compilation issue msys2 #7399 (#7409)
cce3a66f0 Delete .travis directory
8d1cc6ac7 Revert "Compilation issue msys2 (#7403)" (#7407)
5b207639a Update readme.md
359e0f9d6 Revert "grpc/compiler: Respect filename suffix and extension during code generation (#7343)" (#7406)
ebbed0513 Delete cpp-linter.yml
aa395e5a5 (#7323) Rename CMake files according to project name (#7378)
32328075d Fix error msg format when generate GRPC failed (#7350)
97e89c5ac grpc/compiler: Respect filename suffix and extension during code generation (#7343)
5f6672be4 Fix Clang-Cl compile on Windows (#7308)
28e858c85 [TS/Bazel] Minor improvements to typescript.bzl (#7300)
987bebe67 [TS] fix incorrect reverse when writting array of structs (#7271)
ec0129369 Fix FlexBuffers Verifier tracking vectors reuse at wrong offset
50dd385b3 Add missing const (#7401)
da702cfd8 Compilation issue msys2 (#7403)
6e2791640 keep-prefix keeps relative pathing (#7394)
52fce5e53 fix(#7360): grpc used deprecated functions (#7361)
b7f13cd8e cpp_generator: comment out unused parameter to avoid warnings (#7381)
e42985e5a Updated Newtonsoft.Json to 13.0.1 (#7393)
0a8064637 Fix references to LICENSE file (#7377)
b9eea76a8 [Dart] Implement putBool to fix errors when serializing structs with bools (#7359)
1b9030015 Bump Newtonsoft.Json from 12.0.3 to 13.0.1 in /tests/FlatBuffers.Test (#7363)
83a43fc79 Reenable optional json (#7352)
5f0137602 Only include direct included filed (#7348)
9a1913a87 Revert "Implement optional scalars for JSON (#7322)" (#7351)
b4647beb8 Revert "Move reflection_ts_fbs into a separate directory (#7342)" (#7349)
d6060977a Remove asserting in verifier for flattests
987aa5b5e move -Wextra-semi to GCC 8.0+
42acdb63c [TS] Don't generate self-imports with --ts-flat-file (#7340)
0cc1aeb8c [golang] Create missing namespace directory structure (#7324) (#7325)
ba6c67170 [Kotlin] Remove download benchmark files dependency (#7314)
d2f33fc45 Disable Android on Linux CI build
0d1b72cbc [TS] fix ts import path issue (#7298)
9fce2fbf2 replace io/ioutil to os (#7281)
a18ea40d6 Implement optional scalars for JSON (#7322)
090caa280 Move reflection_ts_fbs into a separate directory (#7342)
49e1ea333 Implement optional scalars for Python (#7318)
11a198870 Started implementation for private flags in rust (#7269)
967df08b1 Adds full supposed for Wasm in the swift lib (#7328)
9aa08a429 Use keep case for Rust union discriminant type. (#7321)
9e8c758f5 Add explicit return types to lobster generated code (#7312)
74a25536b Add size check to fix out of bounds read risk (#7304)
12917af8a Update Rust docs page (#7296)
1ea2472f7 [swift] add had<ArrayName> property for arrays to check presence in a message (#7280)
0fe13cb28 Remove span ConstIterator/cbegin()/cend(). (#7295)
385dddc66 Namerkot (#7245)
750dde766 Make `flatc` generate Rust files not requiring `std` (#7273)
9917a168c [swift] Make swift module public (#7274)
76d3cca19 Rust: fix a name conflict when building with "no_std" feature (#7268)
c86e6d0e3 json inf parsing
d34dc32c2 fix include order
234d86c92 fixed off-by-one in parser
746c73b91 Add Annotations for Monster schema and example buffer
0bbfd4b2e fixes for annotator
716521953 Update readme.md (#7257)
a45f564cf [performance] Add aggressive systematic inlining in ByteBuffer and FlatBufferBuilder (#7253)
9d45a6403 more google merge fixes
ccfb4c20b Handle +/-inf in protos (#7256)
7bcd857b8 Specialize CreateVector with std::initializer_list (#7254)
23c8ab34c Swift update performance benchmark infrastructure (#7255)
70002dc5c various fixes for google merge
6e0e79f24 Add test for nested buffer verifier (#7252)
b856368d7 Turn off go modules temporary until we get a proper fix (#7251)
e37156a30 Keep the underlying storage capacity when clearing the FlatBufferBuilder. Gives a significant performance boost for serialisation of many small messages. (#7250)
a10b0e546 Java namer variable keep case (#7249)
275b73994 allow overriding FLATBUFFERS_MAX_ALIGNMENT
9d1ce9a10 Add parameter back to EndVector (#7246)
79afe6c3d Make Java namespaces keep case by default (#7243)
c6dbb2230 Add write permissions for labeller
18bacd3ea Expand test to make sure {}-initializers are properly understood by template. (#7242)
a2c913aec Add -Wnon-virtual-dtor
67b33b294 set workflows permissions to read-only (#7239)
7b5fd2bd0 [Kotlin] Fix key lookup returning null clashing with default value (#7237)
7181d7770 [Java] Fix key lookup returning null clashing with default value (#7236)
7f663b120 Allow CreateVectorOfStrings() to work with any string-type. (#7238)
173ebb694 Fixes a bug where the create function doesnt optional + required items (#7228)
d65823948 [Kotlin] Update gradle to 7.4.1 and simplify config files. (#7231)
ab4bf59e8 remove toascii (#7234)
eee44bbb2 disable cpp-linter (#7229)
a63fa51a1 Create cpp-linter.yml (#7208)
2049e5210 Adds a way to verify/exposes Entities ids (#7221)
832c618f5 Adds implementation flag for swift (#7202)
14615699f Started to migrate to target_compile_options (#7222)
20aad0c41 [C++] stl_emulation span::count_ is not const anymore (#7226) (#7227)
f083b33f2 code gen flexbuffer verifier (#7207)
bf17df346 [C++] generate sorted #include directives (#7213)
35281dedb Fix for [C++] flatc generates invalid Code in the default constructor for structs, when --cpp-field-case-style is used #7209 (#7211)
c9651b742 Add overloads for C# ByteBuffer/FlatBufferBuilder to allow adding vector blocks from ArraySegments or IntPtr (#7193)
26c3b3ada Update codeql.yml
da6e1b985 Update codeql.yml
ad27d751e Added Oss fuzz badge
0aab623cb Create codeql.yml
6a446bdd8 maximize parallel builds in CI (#7206)
21fb5cbbc Create scorecards.yml
0da6f9486 [C++] Static assert on Flatbuffers Version (#7203)
59e971308 reduce fuzzing time to 1 minute in CI
40866a892 fixed padding in struct for annotated binary (#7199)
b71d968fa Apply Namer prefix/suffix to other generators (#7197)
fac0d7be0 Apply Namer to Java. (#7194)
6c5603fd9 [C#] Fix collision of field name and type name (#7149)
2d21853a7 monster fuzzer fix for json default scalars
fec1a8d01 [swift] Add bazel configuration for Swift (#7195)
7fd857623 structured comments (#7192)
a4cb1599d Namerdart (#7187)
ae4ce7265 fuzzed binary annotator (#7188)
e2be0c0b0 Handle root offset and root table vtable invalidation (#7177)
2ad408697 [TS] Fix generation of struct members in object api (#7148)
4213d9105 VerifySizePrefixed (reflection::Schema) and GetAnySizePrefixedRoot added (#7181)
5a13f622c Correctly parse lists of enums in Dart generated code (#7157)
23a7e4e0b Adds no-includes flags to the swift code generator (#7182)
eeb49c275 Move flatbuffer_ts_library to typescript.bzl (#7183)
824763b31 Typo in flatc options (warning-as-errors instead of warnings-as-errors) (#7180)
d3aeee32b Annotated Flatbuffer Binary (#7174)
0bceba24d [Lua] Apply Namer to Lua (#7171)
b8c77d404 Make inclusion of header <optional> opt-out via macro (#7168)
8468eab83 Namersw (#7167)
2b2e8d4ae Nameroverloads (#7164)
b80b32bfa Use DESCRIPTION only if CMake version >= 3.9 (#7166)
Change-Id: Ic2681dabb1a798b7515e62753ee06aecb9933260
git-subtree-dir: third_party/flatbuffers
git-subtree-split: bc44fad35271e43fd7a79b4d691ac9e41708797f
Signed-off-by: Austin Schuh <austin.schuh@bluerivertech.com>
diff --git a/tests/ts/my-game/example/monster.js b/tests/ts/my-game/example/monster.js
new file mode 100644
index 0000000..e4ef970
--- /dev/null
+++ b/tests/ts/my-game/example/monster.js
@@ -0,0 +1,1125 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+import * as flatbuffers from 'flatbuffers';
+import { Ability } from '../../my-game/example/ability.js';
+import { Any, unionToAny } from '../../my-game/example/any.js';
+import { AnyAmbiguousAliases, unionToAnyAmbiguousAliases } from '../../my-game/example/any-ambiguous-aliases.js';
+import { AnyUniqueAliases, unionToAnyUniqueAliases } from '../../my-game/example/any-unique-aliases.js';
+import { Color } from '../../my-game/example/color.js';
+import { Race } from '../../my-game/example/race.js';
+import { Referrable } from '../../my-game/example/referrable.js';
+import { Stat } from '../../my-game/example/stat.js';
+import { Test } from '../../my-game/example/test.js';
+import { Vec3 } from '../../my-game/example/vec3.js';
+import { InParentNamespace } from '../../my-game/in-parent-namespace.js';
+/**
+ * an example documentation comment: "monster object"
+ */
+export class Monster {
+ constructor() {
+ this.bb = null;
+ this.bb_pos = 0;
+ }
+ __init(i, bb) {
+ this.bb_pos = i;
+ this.bb = bb;
+ return this;
+ }
+ static getRootAsMonster(bb, obj) {
+ return (obj || new Monster()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
+ }
+ static getSizePrefixedRootAsMonster(bb, obj) {
+ bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
+ return (obj || new Monster()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
+ }
+ static bufferHasIdentifier(bb) {
+ return bb.__has_identifier('MONS');
+ }
+ pos(obj) {
+ const offset = this.bb.__offset(this.bb_pos, 4);
+ return offset ? (obj || new Vec3()).__init(this.bb_pos + offset, this.bb) : null;
+ }
+ mana() {
+ const offset = this.bb.__offset(this.bb_pos, 6);
+ return offset ? this.bb.readInt16(this.bb_pos + offset) : 150;
+ }
+ mutate_mana(value) {
+ const offset = this.bb.__offset(this.bb_pos, 6);
+ if (offset === 0) {
+ return false;
+ }
+ this.bb.writeInt16(this.bb_pos + offset, value);
+ return true;
+ }
+ hp() {
+ const offset = this.bb.__offset(this.bb_pos, 8);
+ return offset ? this.bb.readInt16(this.bb_pos + offset) : 100;
+ }
+ mutate_hp(value) {
+ const offset = this.bb.__offset(this.bb_pos, 8);
+ if (offset === 0) {
+ return false;
+ }
+ this.bb.writeInt16(this.bb_pos + offset, value);
+ return true;
+ }
+ name(optionalEncoding) {
+ const offset = this.bb.__offset(this.bb_pos, 10);
+ return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
+ }
+ inventory(index) {
+ const offset = this.bb.__offset(this.bb_pos, 14);
+ return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
+ }
+ inventoryLength() {
+ const offset = this.bb.__offset(this.bb_pos, 14);
+ return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+ }
+ inventoryArray() {
+ const offset = this.bb.__offset(this.bb_pos, 14);
+ 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;
+ }
+ color() {
+ const offset = this.bb.__offset(this.bb_pos, 16);
+ return offset ? this.bb.readUint8(this.bb_pos + offset) : Color.Blue;
+ }
+ mutate_color(value) {
+ const offset = this.bb.__offset(this.bb_pos, 16);
+ if (offset === 0) {
+ return false;
+ }
+ this.bb.writeUint8(this.bb_pos + offset, value);
+ return true;
+ }
+ testType() {
+ const offset = this.bb.__offset(this.bb_pos, 18);
+ return offset ? this.bb.readUint8(this.bb_pos + offset) : Any.NONE;
+ }
+ test(obj) {
+ const offset = this.bb.__offset(this.bb_pos, 20);
+ return offset ? this.bb.__union(obj, this.bb_pos + offset) : null;
+ }
+ test4(index, obj) {
+ const offset = this.bb.__offset(this.bb_pos, 22);
+ return offset ? (obj || new Test()).__init(this.bb.__vector(this.bb_pos + offset) + index * 4, this.bb) : null;
+ }
+ test4Length() {
+ const offset = this.bb.__offset(this.bb_pos, 22);
+ return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+ }
+ testarrayofstring(index, optionalEncoding) {
+ const offset = this.bb.__offset(this.bb_pos, 24);
+ return offset ? this.bb.__string(this.bb.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
+ }
+ testarrayofstringLength() {
+ const offset = this.bb.__offset(this.bb_pos, 24);
+ return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+ }
+ /**
+ * an example documentation comment: this will end up in the generated code
+ * multiline too
+ */
+ testarrayoftables(index, obj) {
+ const offset = this.bb.__offset(this.bb_pos, 26);
+ return offset ? (obj || new Monster()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
+ }
+ testarrayoftablesLength() {
+ const offset = this.bb.__offset(this.bb_pos, 26);
+ return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+ }
+ enemy(obj) {
+ const offset = this.bb.__offset(this.bb_pos, 28);
+ return offset ? (obj || new Monster()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
+ }
+ testnestedflatbuffer(index) {
+ const offset = this.bb.__offset(this.bb_pos, 30);
+ return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
+ }
+ testnestedflatbufferLength() {
+ const offset = this.bb.__offset(this.bb_pos, 30);
+ return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+ }
+ testnestedflatbufferArray() {
+ const offset = this.bb.__offset(this.bb_pos, 30);
+ 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;
+ }
+ testempty(obj) {
+ const offset = this.bb.__offset(this.bb_pos, 32);
+ return offset ? (obj || new Stat()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
+ }
+ testbool() {
+ const offset = this.bb.__offset(this.bb_pos, 34);
+ return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
+ }
+ mutate_testbool(value) {
+ const offset = this.bb.__offset(this.bb_pos, 34);
+ if (offset === 0) {
+ return false;
+ }
+ this.bb.writeInt8(this.bb_pos + offset, +value);
+ return true;
+ }
+ testhashs32Fnv1() {
+ const offset = this.bb.__offset(this.bb_pos, 36);
+ return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
+ }
+ mutate_testhashs32_fnv1(value) {
+ const offset = this.bb.__offset(this.bb_pos, 36);
+ if (offset === 0) {
+ return false;
+ }
+ this.bb.writeInt32(this.bb_pos + offset, value);
+ return true;
+ }
+ testhashu32Fnv1() {
+ const offset = this.bb.__offset(this.bb_pos, 38);
+ return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
+ }
+ mutate_testhashu32_fnv1(value) {
+ const offset = this.bb.__offset(this.bb_pos, 38);
+ if (offset === 0) {
+ return false;
+ }
+ this.bb.writeUint32(this.bb_pos + offset, value);
+ return true;
+ }
+ testhashs64Fnv1() {
+ const offset = this.bb.__offset(this.bb_pos, 40);
+ return offset ? this.bb.readInt64(this.bb_pos + offset) : BigInt('0');
+ }
+ mutate_testhashs64_fnv1(value) {
+ const offset = this.bb.__offset(this.bb_pos, 40);
+ if (offset === 0) {
+ return false;
+ }
+ this.bb.writeInt64(this.bb_pos + offset, value);
+ return true;
+ }
+ testhashu64Fnv1() {
+ const offset = this.bb.__offset(this.bb_pos, 42);
+ return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0');
+ }
+ mutate_testhashu64_fnv1(value) {
+ const offset = this.bb.__offset(this.bb_pos, 42);
+ if (offset === 0) {
+ return false;
+ }
+ this.bb.writeUint64(this.bb_pos + offset, value);
+ return true;
+ }
+ testhashs32Fnv1a() {
+ const offset = this.bb.__offset(this.bb_pos, 44);
+ return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
+ }
+ mutate_testhashs32_fnv1a(value) {
+ const offset = this.bb.__offset(this.bb_pos, 44);
+ if (offset === 0) {
+ return false;
+ }
+ this.bb.writeInt32(this.bb_pos + offset, value);
+ return true;
+ }
+ testhashu32Fnv1a() {
+ const offset = this.bb.__offset(this.bb_pos, 46);
+ return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
+ }
+ mutate_testhashu32_fnv1a(value) {
+ const offset = this.bb.__offset(this.bb_pos, 46);
+ if (offset === 0) {
+ return false;
+ }
+ this.bb.writeUint32(this.bb_pos + offset, value);
+ return true;
+ }
+ testhashs64Fnv1a() {
+ const offset = this.bb.__offset(this.bb_pos, 48);
+ return offset ? this.bb.readInt64(this.bb_pos + offset) : BigInt('0');
+ }
+ mutate_testhashs64_fnv1a(value) {
+ const offset = this.bb.__offset(this.bb_pos, 48);
+ if (offset === 0) {
+ return false;
+ }
+ this.bb.writeInt64(this.bb_pos + offset, value);
+ return true;
+ }
+ testhashu64Fnv1a() {
+ const offset = this.bb.__offset(this.bb_pos, 50);
+ return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0');
+ }
+ mutate_testhashu64_fnv1a(value) {
+ const offset = this.bb.__offset(this.bb_pos, 50);
+ if (offset === 0) {
+ return false;
+ }
+ this.bb.writeUint64(this.bb_pos + offset, value);
+ return true;
+ }
+ testarrayofbools(index) {
+ const offset = this.bb.__offset(this.bb_pos, 52);
+ return offset ? !!this.bb.readInt8(this.bb.__vector(this.bb_pos + offset) + index) : false;
+ }
+ testarrayofboolsLength() {
+ const offset = this.bb.__offset(this.bb_pos, 52);
+ return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+ }
+ testarrayofboolsArray() {
+ const offset = this.bb.__offset(this.bb_pos, 52);
+ 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;
+ }
+ testf() {
+ const offset = this.bb.__offset(this.bb_pos, 54);
+ return offset ? this.bb.readFloat32(this.bb_pos + offset) : 3.14159;
+ }
+ mutate_testf(value) {
+ const offset = this.bb.__offset(this.bb_pos, 54);
+ if (offset === 0) {
+ return false;
+ }
+ this.bb.writeFloat32(this.bb_pos + offset, value);
+ return true;
+ }
+ testf2() {
+ const offset = this.bb.__offset(this.bb_pos, 56);
+ return offset ? this.bb.readFloat32(this.bb_pos + offset) : 3.0;
+ }
+ mutate_testf2(value) {
+ const offset = this.bb.__offset(this.bb_pos, 56);
+ if (offset === 0) {
+ return false;
+ }
+ this.bb.writeFloat32(this.bb_pos + offset, value);
+ return true;
+ }
+ testf3() {
+ const offset = this.bb.__offset(this.bb_pos, 58);
+ return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0.0;
+ }
+ mutate_testf3(value) {
+ const offset = this.bb.__offset(this.bb_pos, 58);
+ if (offset === 0) {
+ return false;
+ }
+ this.bb.writeFloat32(this.bb_pos + offset, value);
+ return true;
+ }
+ testarrayofstring2(index, optionalEncoding) {
+ const offset = this.bb.__offset(this.bb_pos, 60);
+ return offset ? this.bb.__string(this.bb.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
+ }
+ testarrayofstring2Length() {
+ const offset = this.bb.__offset(this.bb_pos, 60);
+ return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+ }
+ testarrayofsortedstruct(index, obj) {
+ const offset = this.bb.__offset(this.bb_pos, 62);
+ return offset ? (obj || new Ability()).__init(this.bb.__vector(this.bb_pos + offset) + index * 8, this.bb) : null;
+ }
+ testarrayofsortedstructLength() {
+ const offset = this.bb.__offset(this.bb_pos, 62);
+ return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+ }
+ flex(index) {
+ const offset = this.bb.__offset(this.bb_pos, 64);
+ return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
+ }
+ flexLength() {
+ const offset = this.bb.__offset(this.bb_pos, 64);
+ return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+ }
+ flexArray() {
+ const offset = this.bb.__offset(this.bb_pos, 64);
+ 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;
+ }
+ test5(index, obj) {
+ const offset = this.bb.__offset(this.bb_pos, 66);
+ return offset ? (obj || new Test()).__init(this.bb.__vector(this.bb_pos + offset) + index * 4, this.bb) : null;
+ }
+ test5Length() {
+ const offset = this.bb.__offset(this.bb_pos, 66);
+ return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+ }
+ vectorOfLongs(index) {
+ const offset = this.bb.__offset(this.bb_pos, 68);
+ return offset ? this.bb.readInt64(this.bb.__vector(this.bb_pos + offset) + index * 8) : BigInt(0);
+ }
+ vectorOfLongsLength() {
+ const offset = this.bb.__offset(this.bb_pos, 68);
+ return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+ }
+ vectorOfDoubles(index) {
+ const offset = this.bb.__offset(this.bb_pos, 70);
+ return offset ? this.bb.readFloat64(this.bb.__vector(this.bb_pos + offset) + index * 8) : 0;
+ }
+ vectorOfDoublesLength() {
+ const offset = this.bb.__offset(this.bb_pos, 70);
+ return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+ }
+ vectorOfDoublesArray() {
+ const offset = this.bb.__offset(this.bb_pos, 70);
+ 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;
+ }
+ parentNamespaceTest(obj) {
+ const offset = this.bb.__offset(this.bb_pos, 72);
+ return offset ? (obj || new InParentNamespace()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
+ }
+ vectorOfReferrables(index, obj) {
+ const offset = this.bb.__offset(this.bb_pos, 74);
+ return offset ? (obj || new Referrable()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
+ }
+ vectorOfReferrablesLength() {
+ const offset = this.bb.__offset(this.bb_pos, 74);
+ return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+ }
+ singleWeakReference() {
+ const offset = this.bb.__offset(this.bb_pos, 76);
+ return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0');
+ }
+ mutate_single_weak_reference(value) {
+ const offset = this.bb.__offset(this.bb_pos, 76);
+ if (offset === 0) {
+ return false;
+ }
+ this.bb.writeUint64(this.bb_pos + offset, value);
+ return true;
+ }
+ vectorOfWeakReferences(index) {
+ const offset = this.bb.__offset(this.bb_pos, 78);
+ return offset ? this.bb.readUint64(this.bb.__vector(this.bb_pos + offset) + index * 8) : BigInt(0);
+ }
+ vectorOfWeakReferencesLength() {
+ const offset = this.bb.__offset(this.bb_pos, 78);
+ return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+ }
+ vectorOfStrongReferrables(index, obj) {
+ const offset = this.bb.__offset(this.bb_pos, 80);
+ return offset ? (obj || new Referrable()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
+ }
+ vectorOfStrongReferrablesLength() {
+ const offset = this.bb.__offset(this.bb_pos, 80);
+ return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+ }
+ coOwningReference() {
+ const offset = this.bb.__offset(this.bb_pos, 82);
+ return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0');
+ }
+ mutate_co_owning_reference(value) {
+ const offset = this.bb.__offset(this.bb_pos, 82);
+ if (offset === 0) {
+ return false;
+ }
+ this.bb.writeUint64(this.bb_pos + offset, value);
+ return true;
+ }
+ vectorOfCoOwningReferences(index) {
+ const offset = this.bb.__offset(this.bb_pos, 84);
+ return offset ? this.bb.readUint64(this.bb.__vector(this.bb_pos + offset) + index * 8) : BigInt(0);
+ }
+ vectorOfCoOwningReferencesLength() {
+ const offset = this.bb.__offset(this.bb_pos, 84);
+ return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+ }
+ nonOwningReference() {
+ const offset = this.bb.__offset(this.bb_pos, 86);
+ return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0');
+ }
+ mutate_non_owning_reference(value) {
+ const offset = this.bb.__offset(this.bb_pos, 86);
+ if (offset === 0) {
+ return false;
+ }
+ this.bb.writeUint64(this.bb_pos + offset, value);
+ return true;
+ }
+ vectorOfNonOwningReferences(index) {
+ const offset = this.bb.__offset(this.bb_pos, 88);
+ return offset ? this.bb.readUint64(this.bb.__vector(this.bb_pos + offset) + index * 8) : BigInt(0);
+ }
+ vectorOfNonOwningReferencesLength() {
+ const offset = this.bb.__offset(this.bb_pos, 88);
+ return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+ }
+ anyUniqueType() {
+ const offset = this.bb.__offset(this.bb_pos, 90);
+ return offset ? this.bb.readUint8(this.bb_pos + offset) : AnyUniqueAliases.NONE;
+ }
+ anyUnique(obj) {
+ const offset = this.bb.__offset(this.bb_pos, 92);
+ return offset ? this.bb.__union(obj, this.bb_pos + offset) : null;
+ }
+ anyAmbiguousType() {
+ const offset = this.bb.__offset(this.bb_pos, 94);
+ return offset ? this.bb.readUint8(this.bb_pos + offset) : AnyAmbiguousAliases.NONE;
+ }
+ anyAmbiguous(obj) {
+ const offset = this.bb.__offset(this.bb_pos, 96);
+ return offset ? this.bb.__union(obj, this.bb_pos + offset) : null;
+ }
+ vectorOfEnums(index) {
+ const offset = this.bb.__offset(this.bb_pos, 98);
+ return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
+ }
+ vectorOfEnumsLength() {
+ const offset = this.bb.__offset(this.bb_pos, 98);
+ return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+ }
+ vectorOfEnumsArray() {
+ const offset = this.bb.__offset(this.bb_pos, 98);
+ 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;
+ }
+ signedEnum() {
+ const offset = this.bb.__offset(this.bb_pos, 100);
+ return offset ? this.bb.readInt8(this.bb_pos + offset) : Race.None;
+ }
+ mutate_signed_enum(value) {
+ const offset = this.bb.__offset(this.bb_pos, 100);
+ if (offset === 0) {
+ return false;
+ }
+ this.bb.writeInt8(this.bb_pos + offset, value);
+ return true;
+ }
+ testrequirednestedflatbuffer(index) {
+ const offset = this.bb.__offset(this.bb_pos, 102);
+ return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
+ }
+ testrequirednestedflatbufferLength() {
+ const offset = this.bb.__offset(this.bb_pos, 102);
+ return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+ }
+ testrequirednestedflatbufferArray() {
+ const offset = this.bb.__offset(this.bb_pos, 102);
+ 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;
+ }
+ scalarKeySortedTables(index, obj) {
+ const offset = this.bb.__offset(this.bb_pos, 104);
+ return offset ? (obj || new Stat()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
+ }
+ scalarKeySortedTablesLength() {
+ const offset = this.bb.__offset(this.bb_pos, 104);
+ return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+ }
+ nativeInline(obj) {
+ const offset = this.bb.__offset(this.bb_pos, 106);
+ return offset ? (obj || new Test()).__init(this.bb_pos + offset, this.bb) : null;
+ }
+ longEnumNonEnumDefault() {
+ const offset = this.bb.__offset(this.bb_pos, 108);
+ return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0');
+ }
+ mutate_long_enum_non_enum_default(value) {
+ const offset = this.bb.__offset(this.bb_pos, 108);
+ if (offset === 0) {
+ return false;
+ }
+ this.bb.writeUint64(this.bb_pos + offset, value);
+ return true;
+ }
+ longEnumNormalDefault() {
+ const offset = this.bb.__offset(this.bb_pos, 110);
+ return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('2');
+ }
+ mutate_long_enum_normal_default(value) {
+ const offset = this.bb.__offset(this.bb_pos, 110);
+ if (offset === 0) {
+ return false;
+ }
+ this.bb.writeUint64(this.bb_pos + offset, value);
+ return true;
+ }
+ static getFullyQualifiedName() {
+ return 'MyGame_Example_Monster';
+ }
+ static startMonster(builder) {
+ builder.startObject(54);
+ }
+ static addPos(builder, posOffset) {
+ builder.addFieldStruct(0, posOffset, 0);
+ }
+ static addMana(builder, mana) {
+ builder.addFieldInt16(1, mana, 150);
+ }
+ static addHp(builder, hp) {
+ builder.addFieldInt16(2, hp, 100);
+ }
+ static addName(builder, nameOffset) {
+ builder.addFieldOffset(3, nameOffset, 0);
+ }
+ static addInventory(builder, inventoryOffset) {
+ builder.addFieldOffset(5, inventoryOffset, 0);
+ }
+ static createInventoryVector(builder, data) {
+ builder.startVector(1, data.length, 1);
+ for (let i = data.length - 1; i >= 0; i--) {
+ builder.addInt8(data[i]);
+ }
+ return builder.endVector();
+ }
+ static startInventoryVector(builder, numElems) {
+ builder.startVector(1, numElems, 1);
+ }
+ static addColor(builder, color) {
+ builder.addFieldInt8(6, color, Color.Blue);
+ }
+ static addTestType(builder, testType) {
+ builder.addFieldInt8(7, testType, Any.NONE);
+ }
+ static addTest(builder, testOffset) {
+ builder.addFieldOffset(8, testOffset, 0);
+ }
+ static addTest4(builder, test4Offset) {
+ builder.addFieldOffset(9, test4Offset, 0);
+ }
+ static startTest4Vector(builder, numElems) {
+ builder.startVector(4, numElems, 2);
+ }
+ static addTestarrayofstring(builder, testarrayofstringOffset) {
+ builder.addFieldOffset(10, testarrayofstringOffset, 0);
+ }
+ static createTestarrayofstringVector(builder, data) {
+ builder.startVector(4, data.length, 4);
+ for (let i = data.length - 1; i >= 0; i--) {
+ builder.addOffset(data[i]);
+ }
+ return builder.endVector();
+ }
+ static startTestarrayofstringVector(builder, numElems) {
+ builder.startVector(4, numElems, 4);
+ }
+ static addTestarrayoftables(builder, testarrayoftablesOffset) {
+ builder.addFieldOffset(11, testarrayoftablesOffset, 0);
+ }
+ static createTestarrayoftablesVector(builder, data) {
+ builder.startVector(4, data.length, 4);
+ for (let i = data.length - 1; i >= 0; i--) {
+ builder.addOffset(data[i]);
+ }
+ return builder.endVector();
+ }
+ static startTestarrayoftablesVector(builder, numElems) {
+ builder.startVector(4, numElems, 4);
+ }
+ static addEnemy(builder, enemyOffset) {
+ builder.addFieldOffset(12, enemyOffset, 0);
+ }
+ static addTestnestedflatbuffer(builder, testnestedflatbufferOffset) {
+ builder.addFieldOffset(13, testnestedflatbufferOffset, 0);
+ }
+ static createTestnestedflatbufferVector(builder, data) {
+ builder.startVector(1, data.length, 1);
+ for (let i = data.length - 1; i >= 0; i--) {
+ builder.addInt8(data[i]);
+ }
+ return builder.endVector();
+ }
+ static startTestnestedflatbufferVector(builder, numElems) {
+ builder.startVector(1, numElems, 1);
+ }
+ static addTestempty(builder, testemptyOffset) {
+ builder.addFieldOffset(14, testemptyOffset, 0);
+ }
+ static addTestbool(builder, testbool) {
+ builder.addFieldInt8(15, +testbool, +false);
+ }
+ static addTesthashs32Fnv1(builder, testhashs32Fnv1) {
+ builder.addFieldInt32(16, testhashs32Fnv1, 0);
+ }
+ static addTesthashu32Fnv1(builder, testhashu32Fnv1) {
+ builder.addFieldInt32(17, testhashu32Fnv1, 0);
+ }
+ static addTesthashs64Fnv1(builder, testhashs64Fnv1) {
+ builder.addFieldInt64(18, testhashs64Fnv1, BigInt('0'));
+ }
+ static addTesthashu64Fnv1(builder, testhashu64Fnv1) {
+ builder.addFieldInt64(19, testhashu64Fnv1, BigInt('0'));
+ }
+ static addTesthashs32Fnv1a(builder, testhashs32Fnv1a) {
+ builder.addFieldInt32(20, testhashs32Fnv1a, 0);
+ }
+ static addTesthashu32Fnv1a(builder, testhashu32Fnv1a) {
+ builder.addFieldInt32(21, testhashu32Fnv1a, 0);
+ }
+ static addTesthashs64Fnv1a(builder, testhashs64Fnv1a) {
+ builder.addFieldInt64(22, testhashs64Fnv1a, BigInt('0'));
+ }
+ static addTesthashu64Fnv1a(builder, testhashu64Fnv1a) {
+ builder.addFieldInt64(23, testhashu64Fnv1a, BigInt('0'));
+ }
+ static addTestarrayofbools(builder, testarrayofboolsOffset) {
+ builder.addFieldOffset(24, testarrayofboolsOffset, 0);
+ }
+ static createTestarrayofboolsVector(builder, data) {
+ builder.startVector(1, data.length, 1);
+ for (let i = data.length - 1; i >= 0; i--) {
+ builder.addInt8(+data[i]);
+ }
+ return builder.endVector();
+ }
+ static startTestarrayofboolsVector(builder, numElems) {
+ builder.startVector(1, numElems, 1);
+ }
+ static addTestf(builder, testf) {
+ builder.addFieldFloat32(25, testf, 3.14159);
+ }
+ static addTestf2(builder, testf2) {
+ builder.addFieldFloat32(26, testf2, 3.0);
+ }
+ static addTestf3(builder, testf3) {
+ builder.addFieldFloat32(27, testf3, 0.0);
+ }
+ static addTestarrayofstring2(builder, testarrayofstring2Offset) {
+ builder.addFieldOffset(28, testarrayofstring2Offset, 0);
+ }
+ static createTestarrayofstring2Vector(builder, data) {
+ builder.startVector(4, data.length, 4);
+ for (let i = data.length - 1; i >= 0; i--) {
+ builder.addOffset(data[i]);
+ }
+ return builder.endVector();
+ }
+ static startTestarrayofstring2Vector(builder, numElems) {
+ builder.startVector(4, numElems, 4);
+ }
+ static addTestarrayofsortedstruct(builder, testarrayofsortedstructOffset) {
+ builder.addFieldOffset(29, testarrayofsortedstructOffset, 0);
+ }
+ static startTestarrayofsortedstructVector(builder, numElems) {
+ builder.startVector(8, numElems, 4);
+ }
+ static addFlex(builder, flexOffset) {
+ builder.addFieldOffset(30, flexOffset, 0);
+ }
+ static createFlexVector(builder, data) {
+ builder.startVector(1, data.length, 1);
+ for (let i = data.length - 1; i >= 0; i--) {
+ builder.addInt8(data[i]);
+ }
+ return builder.endVector();
+ }
+ static startFlexVector(builder, numElems) {
+ builder.startVector(1, numElems, 1);
+ }
+ static addTest5(builder, test5Offset) {
+ builder.addFieldOffset(31, test5Offset, 0);
+ }
+ static startTest5Vector(builder, numElems) {
+ builder.startVector(4, numElems, 2);
+ }
+ static addVectorOfLongs(builder, vectorOfLongsOffset) {
+ builder.addFieldOffset(32, vectorOfLongsOffset, 0);
+ }
+ static createVectorOfLongsVector(builder, data) {
+ builder.startVector(8, data.length, 8);
+ for (let i = data.length - 1; i >= 0; i--) {
+ builder.addInt64(data[i]);
+ }
+ return builder.endVector();
+ }
+ static startVectorOfLongsVector(builder, numElems) {
+ builder.startVector(8, numElems, 8);
+ }
+ static addVectorOfDoubles(builder, vectorOfDoublesOffset) {
+ builder.addFieldOffset(33, vectorOfDoublesOffset, 0);
+ }
+ static createVectorOfDoublesVector(builder, data) {
+ builder.startVector(8, data.length, 8);
+ for (let i = data.length - 1; i >= 0; i--) {
+ builder.addFloat64(data[i]);
+ }
+ return builder.endVector();
+ }
+ static startVectorOfDoublesVector(builder, numElems) {
+ builder.startVector(8, numElems, 8);
+ }
+ static addParentNamespaceTest(builder, parentNamespaceTestOffset) {
+ builder.addFieldOffset(34, parentNamespaceTestOffset, 0);
+ }
+ static addVectorOfReferrables(builder, vectorOfReferrablesOffset) {
+ builder.addFieldOffset(35, vectorOfReferrablesOffset, 0);
+ }
+ static createVectorOfReferrablesVector(builder, data) {
+ builder.startVector(4, data.length, 4);
+ for (let i = data.length - 1; i >= 0; i--) {
+ builder.addOffset(data[i]);
+ }
+ return builder.endVector();
+ }
+ static startVectorOfReferrablesVector(builder, numElems) {
+ builder.startVector(4, numElems, 4);
+ }
+ static addSingleWeakReference(builder, singleWeakReference) {
+ builder.addFieldInt64(36, singleWeakReference, BigInt('0'));
+ }
+ static addVectorOfWeakReferences(builder, vectorOfWeakReferencesOffset) {
+ builder.addFieldOffset(37, vectorOfWeakReferencesOffset, 0);
+ }
+ static createVectorOfWeakReferencesVector(builder, data) {
+ builder.startVector(8, data.length, 8);
+ for (let i = data.length - 1; i >= 0; i--) {
+ builder.addInt64(data[i]);
+ }
+ return builder.endVector();
+ }
+ static startVectorOfWeakReferencesVector(builder, numElems) {
+ builder.startVector(8, numElems, 8);
+ }
+ static addVectorOfStrongReferrables(builder, vectorOfStrongReferrablesOffset) {
+ builder.addFieldOffset(38, vectorOfStrongReferrablesOffset, 0);
+ }
+ static createVectorOfStrongReferrablesVector(builder, data) {
+ builder.startVector(4, data.length, 4);
+ for (let i = data.length - 1; i >= 0; i--) {
+ builder.addOffset(data[i]);
+ }
+ return builder.endVector();
+ }
+ static startVectorOfStrongReferrablesVector(builder, numElems) {
+ builder.startVector(4, numElems, 4);
+ }
+ static addCoOwningReference(builder, coOwningReference) {
+ builder.addFieldInt64(39, coOwningReference, BigInt('0'));
+ }
+ static addVectorOfCoOwningReferences(builder, vectorOfCoOwningReferencesOffset) {
+ builder.addFieldOffset(40, vectorOfCoOwningReferencesOffset, 0);
+ }
+ static createVectorOfCoOwningReferencesVector(builder, data) {
+ builder.startVector(8, data.length, 8);
+ for (let i = data.length - 1; i >= 0; i--) {
+ builder.addInt64(data[i]);
+ }
+ return builder.endVector();
+ }
+ static startVectorOfCoOwningReferencesVector(builder, numElems) {
+ builder.startVector(8, numElems, 8);
+ }
+ static addNonOwningReference(builder, nonOwningReference) {
+ builder.addFieldInt64(41, nonOwningReference, BigInt('0'));
+ }
+ static addVectorOfNonOwningReferences(builder, vectorOfNonOwningReferencesOffset) {
+ builder.addFieldOffset(42, vectorOfNonOwningReferencesOffset, 0);
+ }
+ static createVectorOfNonOwningReferencesVector(builder, data) {
+ builder.startVector(8, data.length, 8);
+ for (let i = data.length - 1; i >= 0; i--) {
+ builder.addInt64(data[i]);
+ }
+ return builder.endVector();
+ }
+ static startVectorOfNonOwningReferencesVector(builder, numElems) {
+ builder.startVector(8, numElems, 8);
+ }
+ static addAnyUniqueType(builder, anyUniqueType) {
+ builder.addFieldInt8(43, anyUniqueType, AnyUniqueAliases.NONE);
+ }
+ static addAnyUnique(builder, anyUniqueOffset) {
+ builder.addFieldOffset(44, anyUniqueOffset, 0);
+ }
+ static addAnyAmbiguousType(builder, anyAmbiguousType) {
+ builder.addFieldInt8(45, anyAmbiguousType, AnyAmbiguousAliases.NONE);
+ }
+ static addAnyAmbiguous(builder, anyAmbiguousOffset) {
+ builder.addFieldOffset(46, anyAmbiguousOffset, 0);
+ }
+ static addVectorOfEnums(builder, vectorOfEnumsOffset) {
+ builder.addFieldOffset(47, vectorOfEnumsOffset, 0);
+ }
+ static createVectorOfEnumsVector(builder, data) {
+ builder.startVector(1, data.length, 1);
+ for (let i = data.length - 1; i >= 0; i--) {
+ builder.addInt8(data[i]);
+ }
+ return builder.endVector();
+ }
+ static startVectorOfEnumsVector(builder, numElems) {
+ builder.startVector(1, numElems, 1);
+ }
+ static addSignedEnum(builder, signedEnum) {
+ builder.addFieldInt8(48, signedEnum, Race.None);
+ }
+ static addTestrequirednestedflatbuffer(builder, testrequirednestedflatbufferOffset) {
+ builder.addFieldOffset(49, testrequirednestedflatbufferOffset, 0);
+ }
+ static createTestrequirednestedflatbufferVector(builder, data) {
+ builder.startVector(1, data.length, 1);
+ for (let i = data.length - 1; i >= 0; i--) {
+ builder.addInt8(data[i]);
+ }
+ return builder.endVector();
+ }
+ static startTestrequirednestedflatbufferVector(builder, numElems) {
+ builder.startVector(1, numElems, 1);
+ }
+ static addScalarKeySortedTables(builder, scalarKeySortedTablesOffset) {
+ builder.addFieldOffset(50, scalarKeySortedTablesOffset, 0);
+ }
+ static createScalarKeySortedTablesVector(builder, data) {
+ builder.startVector(4, data.length, 4);
+ for (let i = data.length - 1; i >= 0; i--) {
+ builder.addOffset(data[i]);
+ }
+ return builder.endVector();
+ }
+ static startScalarKeySortedTablesVector(builder, numElems) {
+ builder.startVector(4, numElems, 4);
+ }
+ static addNativeInline(builder, nativeInlineOffset) {
+ builder.addFieldStruct(51, nativeInlineOffset, 0);
+ }
+ static addLongEnumNonEnumDefault(builder, longEnumNonEnumDefault) {
+ builder.addFieldInt64(52, longEnumNonEnumDefault, BigInt('0'));
+ }
+ static addLongEnumNormalDefault(builder, longEnumNormalDefault) {
+ builder.addFieldInt64(53, longEnumNormalDefault, BigInt('2'));
+ }
+ static endMonster(builder) {
+ const offset = builder.endObject();
+ builder.requiredField(offset, 10); // name
+ return offset;
+ }
+ static finishMonsterBuffer(builder, offset) {
+ builder.finish(offset, 'MONS');
+ }
+ static finishSizePrefixedMonsterBuffer(builder, offset) {
+ builder.finish(offset, 'MONS', true);
+ }
+ serialize() {
+ return this.bb.bytes();
+ }
+ static deserialize(buffer) {
+ return Monster.getRootAsMonster(new flatbuffers.ByteBuffer(buffer));
+ }
+ unpack() {
+ return new MonsterT((this.pos() !== null ? this.pos().unpack() : null), this.mana(), this.hp(), this.name(), this.bb.createScalarList(this.inventory.bind(this), this.inventoryLength()), this.color(), this.testType(), (() => {
+ let temp = unionToAny(this.testType(), this.test.bind(this));
+ if (temp === null) {
+ return null;
+ }
+ return temp.unpack();
+ })(), this.bb.createObjList(this.test4.bind(this), this.test4Length()), this.bb.createScalarList(this.testarrayofstring.bind(this), this.testarrayofstringLength()), this.bb.createObjList(this.testarrayoftables.bind(this), this.testarrayoftablesLength()), (this.enemy() !== null ? this.enemy().unpack() : null), this.bb.createScalarList(this.testnestedflatbuffer.bind(this), this.testnestedflatbufferLength()), (this.testempty() !== null ? this.testempty().unpack() : null), this.testbool(), this.testhashs32Fnv1(), this.testhashu32Fnv1(), this.testhashs64Fnv1(), this.testhashu64Fnv1(), this.testhashs32Fnv1a(), this.testhashu32Fnv1a(), this.testhashs64Fnv1a(), this.testhashu64Fnv1a(), this.bb.createScalarList(this.testarrayofbools.bind(this), this.testarrayofboolsLength()), this.testf(), this.testf2(), this.testf3(), this.bb.createScalarList(this.testarrayofstring2.bind(this), this.testarrayofstring2Length()), this.bb.createObjList(this.testarrayofsortedstruct.bind(this), this.testarrayofsortedstructLength()), this.bb.createScalarList(this.flex.bind(this), this.flexLength()), this.bb.createObjList(this.test5.bind(this), this.test5Length()), this.bb.createScalarList(this.vectorOfLongs.bind(this), this.vectorOfLongsLength()), this.bb.createScalarList(this.vectorOfDoubles.bind(this), this.vectorOfDoublesLength()), (this.parentNamespaceTest() !== null ? this.parentNamespaceTest().unpack() : null), this.bb.createObjList(this.vectorOfReferrables.bind(this), this.vectorOfReferrablesLength()), this.singleWeakReference(), this.bb.createScalarList(this.vectorOfWeakReferences.bind(this), this.vectorOfWeakReferencesLength()), this.bb.createObjList(this.vectorOfStrongReferrables.bind(this), this.vectorOfStrongReferrablesLength()), this.coOwningReference(), this.bb.createScalarList(this.vectorOfCoOwningReferences.bind(this), this.vectorOfCoOwningReferencesLength()), this.nonOwningReference(), this.bb.createScalarList(this.vectorOfNonOwningReferences.bind(this), this.vectorOfNonOwningReferencesLength()), this.anyUniqueType(), (() => {
+ let temp = unionToAnyUniqueAliases(this.anyUniqueType(), this.anyUnique.bind(this));
+ if (temp === null) {
+ return null;
+ }
+ return temp.unpack();
+ })(), this.anyAmbiguousType(), (() => {
+ let temp = unionToAnyAmbiguousAliases(this.anyAmbiguousType(), this.anyAmbiguous.bind(this));
+ if (temp === null) {
+ return null;
+ }
+ return temp.unpack();
+ })(), this.bb.createScalarList(this.vectorOfEnums.bind(this), this.vectorOfEnumsLength()), this.signedEnum(), this.bb.createScalarList(this.testrequirednestedflatbuffer.bind(this), this.testrequirednestedflatbufferLength()), this.bb.createObjList(this.scalarKeySortedTables.bind(this), this.scalarKeySortedTablesLength()), (this.nativeInline() !== null ? this.nativeInline().unpack() : null), this.longEnumNonEnumDefault(), this.longEnumNormalDefault());
+ }
+ unpackTo(_o) {
+ _o.pos = (this.pos() !== null ? this.pos().unpack() : null);
+ _o.mana = this.mana();
+ _o.hp = this.hp();
+ _o.name = this.name();
+ _o.inventory = this.bb.createScalarList(this.inventory.bind(this), this.inventoryLength());
+ _o.color = this.color();
+ _o.testType = this.testType();
+ _o.test = (() => {
+ let temp = unionToAny(this.testType(), this.test.bind(this));
+ if (temp === null) {
+ return null;
+ }
+ return temp.unpack();
+ })();
+ _o.test4 = this.bb.createObjList(this.test4.bind(this), this.test4Length());
+ _o.testarrayofstring = this.bb.createScalarList(this.testarrayofstring.bind(this), this.testarrayofstringLength());
+ _o.testarrayoftables = this.bb.createObjList(this.testarrayoftables.bind(this), this.testarrayoftablesLength());
+ _o.enemy = (this.enemy() !== null ? this.enemy().unpack() : null);
+ _o.testnestedflatbuffer = this.bb.createScalarList(this.testnestedflatbuffer.bind(this), this.testnestedflatbufferLength());
+ _o.testempty = (this.testempty() !== null ? this.testempty().unpack() : null);
+ _o.testbool = this.testbool();
+ _o.testhashs32Fnv1 = this.testhashs32Fnv1();
+ _o.testhashu32Fnv1 = this.testhashu32Fnv1();
+ _o.testhashs64Fnv1 = this.testhashs64Fnv1();
+ _o.testhashu64Fnv1 = this.testhashu64Fnv1();
+ _o.testhashs32Fnv1a = this.testhashs32Fnv1a();
+ _o.testhashu32Fnv1a = this.testhashu32Fnv1a();
+ _o.testhashs64Fnv1a = this.testhashs64Fnv1a();
+ _o.testhashu64Fnv1a = this.testhashu64Fnv1a();
+ _o.testarrayofbools = this.bb.createScalarList(this.testarrayofbools.bind(this), this.testarrayofboolsLength());
+ _o.testf = this.testf();
+ _o.testf2 = this.testf2();
+ _o.testf3 = this.testf3();
+ _o.testarrayofstring2 = this.bb.createScalarList(this.testarrayofstring2.bind(this), this.testarrayofstring2Length());
+ _o.testarrayofsortedstruct = this.bb.createObjList(this.testarrayofsortedstruct.bind(this), this.testarrayofsortedstructLength());
+ _o.flex = this.bb.createScalarList(this.flex.bind(this), this.flexLength());
+ _o.test5 = this.bb.createObjList(this.test5.bind(this), this.test5Length());
+ _o.vectorOfLongs = this.bb.createScalarList(this.vectorOfLongs.bind(this), this.vectorOfLongsLength());
+ _o.vectorOfDoubles = this.bb.createScalarList(this.vectorOfDoubles.bind(this), this.vectorOfDoublesLength());
+ _o.parentNamespaceTest = (this.parentNamespaceTest() !== null ? this.parentNamespaceTest().unpack() : null);
+ _o.vectorOfReferrables = this.bb.createObjList(this.vectorOfReferrables.bind(this), this.vectorOfReferrablesLength());
+ _o.singleWeakReference = this.singleWeakReference();
+ _o.vectorOfWeakReferences = this.bb.createScalarList(this.vectorOfWeakReferences.bind(this), this.vectorOfWeakReferencesLength());
+ _o.vectorOfStrongReferrables = this.bb.createObjList(this.vectorOfStrongReferrables.bind(this), this.vectorOfStrongReferrablesLength());
+ _o.coOwningReference = this.coOwningReference();
+ _o.vectorOfCoOwningReferences = this.bb.createScalarList(this.vectorOfCoOwningReferences.bind(this), this.vectorOfCoOwningReferencesLength());
+ _o.nonOwningReference = this.nonOwningReference();
+ _o.vectorOfNonOwningReferences = this.bb.createScalarList(this.vectorOfNonOwningReferences.bind(this), this.vectorOfNonOwningReferencesLength());
+ _o.anyUniqueType = this.anyUniqueType();
+ _o.anyUnique = (() => {
+ let temp = unionToAnyUniqueAliases(this.anyUniqueType(), this.anyUnique.bind(this));
+ if (temp === null) {
+ return null;
+ }
+ return temp.unpack();
+ })();
+ _o.anyAmbiguousType = this.anyAmbiguousType();
+ _o.anyAmbiguous = (() => {
+ let temp = unionToAnyAmbiguousAliases(this.anyAmbiguousType(), this.anyAmbiguous.bind(this));
+ if (temp === null) {
+ return null;
+ }
+ return temp.unpack();
+ })();
+ _o.vectorOfEnums = this.bb.createScalarList(this.vectorOfEnums.bind(this), this.vectorOfEnumsLength());
+ _o.signedEnum = this.signedEnum();
+ _o.testrequirednestedflatbuffer = this.bb.createScalarList(this.testrequirednestedflatbuffer.bind(this), this.testrequirednestedflatbufferLength());
+ _o.scalarKeySortedTables = this.bb.createObjList(this.scalarKeySortedTables.bind(this), this.scalarKeySortedTablesLength());
+ _o.nativeInline = (this.nativeInline() !== null ? this.nativeInline().unpack() : null);
+ _o.longEnumNonEnumDefault = this.longEnumNonEnumDefault();
+ _o.longEnumNormalDefault = this.longEnumNormalDefault();
+ }
+}
+export class MonsterT {
+ constructor(pos = null, mana = 150, hp = 100, name = null, inventory = [], color = Color.Blue, testType = Any.NONE, test = null, test4 = [], testarrayofstring = [], testarrayoftables = [], enemy = null, testnestedflatbuffer = [], testempty = null, testbool = false, testhashs32Fnv1 = 0, testhashu32Fnv1 = 0, testhashs64Fnv1 = BigInt('0'), testhashu64Fnv1 = BigInt('0'), testhashs32Fnv1a = 0, testhashu32Fnv1a = 0, testhashs64Fnv1a = BigInt('0'), testhashu64Fnv1a = BigInt('0'), testarrayofbools = [], testf = 3.14159, testf2 = 3.0, testf3 = 0.0, testarrayofstring2 = [], testarrayofsortedstruct = [], flex = [], test5 = [], vectorOfLongs = [], vectorOfDoubles = [], parentNamespaceTest = null, vectorOfReferrables = [], singleWeakReference = BigInt('0'), vectorOfWeakReferences = [], vectorOfStrongReferrables = [], coOwningReference = BigInt('0'), vectorOfCoOwningReferences = [], nonOwningReference = BigInt('0'), vectorOfNonOwningReferences = [], anyUniqueType = AnyUniqueAliases.NONE, anyUnique = null, anyAmbiguousType = AnyAmbiguousAliases.NONE, anyAmbiguous = null, vectorOfEnums = [], signedEnum = Race.None, testrequirednestedflatbuffer = [], scalarKeySortedTables = [], nativeInline = null, longEnumNonEnumDefault = BigInt('0'), longEnumNormalDefault = BigInt('2')) {
+ this.pos = pos;
+ this.mana = mana;
+ this.hp = hp;
+ this.name = name;
+ this.inventory = inventory;
+ this.color = color;
+ this.testType = testType;
+ this.test = test;
+ this.test4 = test4;
+ this.testarrayofstring = testarrayofstring;
+ this.testarrayoftables = testarrayoftables;
+ this.enemy = enemy;
+ this.testnestedflatbuffer = testnestedflatbuffer;
+ this.testempty = testempty;
+ this.testbool = testbool;
+ this.testhashs32Fnv1 = testhashs32Fnv1;
+ this.testhashu32Fnv1 = testhashu32Fnv1;
+ this.testhashs64Fnv1 = testhashs64Fnv1;
+ this.testhashu64Fnv1 = testhashu64Fnv1;
+ this.testhashs32Fnv1a = testhashs32Fnv1a;
+ this.testhashu32Fnv1a = testhashu32Fnv1a;
+ this.testhashs64Fnv1a = testhashs64Fnv1a;
+ this.testhashu64Fnv1a = testhashu64Fnv1a;
+ this.testarrayofbools = testarrayofbools;
+ this.testf = testf;
+ this.testf2 = testf2;
+ this.testf3 = testf3;
+ this.testarrayofstring2 = testarrayofstring2;
+ this.testarrayofsortedstruct = testarrayofsortedstruct;
+ this.flex = flex;
+ this.test5 = test5;
+ this.vectorOfLongs = vectorOfLongs;
+ this.vectorOfDoubles = vectorOfDoubles;
+ this.parentNamespaceTest = parentNamespaceTest;
+ this.vectorOfReferrables = vectorOfReferrables;
+ this.singleWeakReference = singleWeakReference;
+ this.vectorOfWeakReferences = vectorOfWeakReferences;
+ this.vectorOfStrongReferrables = vectorOfStrongReferrables;
+ this.coOwningReference = coOwningReference;
+ this.vectorOfCoOwningReferences = vectorOfCoOwningReferences;
+ this.nonOwningReference = nonOwningReference;
+ this.vectorOfNonOwningReferences = vectorOfNonOwningReferences;
+ this.anyUniqueType = anyUniqueType;
+ this.anyUnique = anyUnique;
+ this.anyAmbiguousType = anyAmbiguousType;
+ this.anyAmbiguous = anyAmbiguous;
+ this.vectorOfEnums = vectorOfEnums;
+ this.signedEnum = signedEnum;
+ this.testrequirednestedflatbuffer = testrequirednestedflatbuffer;
+ this.scalarKeySortedTables = scalarKeySortedTables;
+ this.nativeInline = nativeInline;
+ this.longEnumNonEnumDefault = longEnumNonEnumDefault;
+ this.longEnumNormalDefault = longEnumNormalDefault;
+ }
+ pack(builder) {
+ const name = (this.name !== null ? builder.createString(this.name) : 0);
+ const inventory = Monster.createInventoryVector(builder, this.inventory);
+ const test = builder.createObjectOffset(this.test);
+ const test4 = builder.createStructOffsetList(this.test4, Monster.startTest4Vector);
+ const testarrayofstring = Monster.createTestarrayofstringVector(builder, builder.createObjectOffsetList(this.testarrayofstring));
+ const testarrayoftables = Monster.createTestarrayoftablesVector(builder, builder.createObjectOffsetList(this.testarrayoftables));
+ const enemy = (this.enemy !== null ? this.enemy.pack(builder) : 0);
+ const testnestedflatbuffer = Monster.createTestnestedflatbufferVector(builder, this.testnestedflatbuffer);
+ const testempty = (this.testempty !== null ? this.testempty.pack(builder) : 0);
+ const testarrayofbools = Monster.createTestarrayofboolsVector(builder, this.testarrayofbools);
+ const testarrayofstring2 = Monster.createTestarrayofstring2Vector(builder, builder.createObjectOffsetList(this.testarrayofstring2));
+ const testarrayofsortedstruct = builder.createStructOffsetList(this.testarrayofsortedstruct, Monster.startTestarrayofsortedstructVector);
+ const flex = Monster.createFlexVector(builder, this.flex);
+ const test5 = builder.createStructOffsetList(this.test5, Monster.startTest5Vector);
+ const vectorOfLongs = Monster.createVectorOfLongsVector(builder, this.vectorOfLongs);
+ const vectorOfDoubles = Monster.createVectorOfDoublesVector(builder, this.vectorOfDoubles);
+ const parentNamespaceTest = (this.parentNamespaceTest !== null ? this.parentNamespaceTest.pack(builder) : 0);
+ const vectorOfReferrables = Monster.createVectorOfReferrablesVector(builder, builder.createObjectOffsetList(this.vectorOfReferrables));
+ const vectorOfWeakReferences = Monster.createVectorOfWeakReferencesVector(builder, this.vectorOfWeakReferences);
+ const vectorOfStrongReferrables = Monster.createVectorOfStrongReferrablesVector(builder, builder.createObjectOffsetList(this.vectorOfStrongReferrables));
+ const vectorOfCoOwningReferences = Monster.createVectorOfCoOwningReferencesVector(builder, this.vectorOfCoOwningReferences);
+ const vectorOfNonOwningReferences = Monster.createVectorOfNonOwningReferencesVector(builder, this.vectorOfNonOwningReferences);
+ const anyUnique = builder.createObjectOffset(this.anyUnique);
+ const anyAmbiguous = builder.createObjectOffset(this.anyAmbiguous);
+ const vectorOfEnums = Monster.createVectorOfEnumsVector(builder, this.vectorOfEnums);
+ const testrequirednestedflatbuffer = Monster.createTestrequirednestedflatbufferVector(builder, this.testrequirednestedflatbuffer);
+ const scalarKeySortedTables = Monster.createScalarKeySortedTablesVector(builder, builder.createObjectOffsetList(this.scalarKeySortedTables));
+ Monster.startMonster(builder);
+ Monster.addPos(builder, (this.pos !== null ? this.pos.pack(builder) : 0));
+ Monster.addMana(builder, this.mana);
+ Monster.addHp(builder, this.hp);
+ Monster.addName(builder, name);
+ Monster.addInventory(builder, inventory);
+ Monster.addColor(builder, this.color);
+ Monster.addTestType(builder, this.testType);
+ Monster.addTest(builder, test);
+ Monster.addTest4(builder, test4);
+ Monster.addTestarrayofstring(builder, testarrayofstring);
+ Monster.addTestarrayoftables(builder, testarrayoftables);
+ Monster.addEnemy(builder, enemy);
+ Monster.addTestnestedflatbuffer(builder, testnestedflatbuffer);
+ Monster.addTestempty(builder, testempty);
+ Monster.addTestbool(builder, this.testbool);
+ Monster.addTesthashs32Fnv1(builder, this.testhashs32Fnv1);
+ Monster.addTesthashu32Fnv1(builder, this.testhashu32Fnv1);
+ Monster.addTesthashs64Fnv1(builder, this.testhashs64Fnv1);
+ Monster.addTesthashu64Fnv1(builder, this.testhashu64Fnv1);
+ Monster.addTesthashs32Fnv1a(builder, this.testhashs32Fnv1a);
+ Monster.addTesthashu32Fnv1a(builder, this.testhashu32Fnv1a);
+ Monster.addTesthashs64Fnv1a(builder, this.testhashs64Fnv1a);
+ Monster.addTesthashu64Fnv1a(builder, this.testhashu64Fnv1a);
+ Monster.addTestarrayofbools(builder, testarrayofbools);
+ Monster.addTestf(builder, this.testf);
+ Monster.addTestf2(builder, this.testf2);
+ Monster.addTestf3(builder, this.testf3);
+ Monster.addTestarrayofstring2(builder, testarrayofstring2);
+ Monster.addTestarrayofsortedstruct(builder, testarrayofsortedstruct);
+ Monster.addFlex(builder, flex);
+ Monster.addTest5(builder, test5);
+ Monster.addVectorOfLongs(builder, vectorOfLongs);
+ Monster.addVectorOfDoubles(builder, vectorOfDoubles);
+ Monster.addParentNamespaceTest(builder, parentNamespaceTest);
+ Monster.addVectorOfReferrables(builder, vectorOfReferrables);
+ Monster.addSingleWeakReference(builder, this.singleWeakReference);
+ Monster.addVectorOfWeakReferences(builder, vectorOfWeakReferences);
+ Monster.addVectorOfStrongReferrables(builder, vectorOfStrongReferrables);
+ Monster.addCoOwningReference(builder, this.coOwningReference);
+ Monster.addVectorOfCoOwningReferences(builder, vectorOfCoOwningReferences);
+ Monster.addNonOwningReference(builder, this.nonOwningReference);
+ Monster.addVectorOfNonOwningReferences(builder, vectorOfNonOwningReferences);
+ Monster.addAnyUniqueType(builder, this.anyUniqueType);
+ Monster.addAnyUnique(builder, anyUnique);
+ Monster.addAnyAmbiguousType(builder, this.anyAmbiguousType);
+ Monster.addAnyAmbiguous(builder, anyAmbiguous);
+ Monster.addVectorOfEnums(builder, vectorOfEnums);
+ Monster.addSignedEnum(builder, this.signedEnum);
+ Monster.addTestrequirednestedflatbuffer(builder, testrequirednestedflatbuffer);
+ Monster.addScalarKeySortedTables(builder, scalarKeySortedTables);
+ Monster.addNativeInline(builder, (this.nativeInline !== null ? this.nativeInline.pack(builder) : 0));
+ Monster.addLongEnumNonEnumDefault(builder, this.longEnumNonEnumDefault);
+ Monster.addLongEnumNormalDefault(builder, this.longEnumNormalDefault);
+ return Monster.endMonster(builder);
+ }
+}