| 1 |
// automatically generated by the FlatBuffers compiler, do not modify |
| 2 |
|
| 3 |
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ |
| 4 |
|
| 5 |
import * as flatbuffers from 'flatbuffers'; |
| 6 |
|
| 7 |
import { Monster as MyGame_Example2_Monster, MonsterT as MyGame_Example2_MonsterT } from '../../my-game/example2/monster.js'; |
| 8 |
import { Ability, AbilityT } from '../../my-game/example/ability.js'; |
| 9 |
import { Any, unionToAny, unionListToAny } from '../../my-game/example/any.js'; |
| 10 |
import { AnyAmbiguousAliases, unionToAnyAmbiguousAliases, unionListToAnyAmbiguousAliases } from '../../my-game/example/any-ambiguous-aliases.js'; |
| 11 |
import { AnyUniqueAliases, unionToAnyUniqueAliases, unionListToAnyUniqueAliases } from '../../my-game/example/any-unique-aliases.js'; |
| 12 |
import { Color } from '../../my-game/example/color.js'; |
| 13 |
import { Race } from '../../my-game/example/race.js'; |
| 14 |
import { Referrable, ReferrableT } from '../../my-game/example/referrable.js'; |
| 15 |
import { Stat, StatT } from '../../my-game/example/stat.js'; |
| 16 |
import { Test, TestT } from '../../my-game/example/test.js'; |
| 17 |
import { TestSimpleTableWithEnum, TestSimpleTableWithEnumT } from '../../my-game/example/test-simple-table-with-enum.js'; |
| 18 |
import { Vec3, Vec3T } from '../../my-game/example/vec3.js'; |
| 19 |
import { InParentNamespace, InParentNamespaceT } from '../../my-game/in-parent-namespace.js'; |
| 20 |
|
| 21 |
|
| 22 |
/** |
| 23 |
* an example documentation comment: "monster object" |
| 24 |
*/ |
| 25 |
export class Monster implements flatbuffers.IUnpackableObject<MonsterT> { |
| 26 |
bb: flatbuffers.ByteBuffer|null = null; |
| 27 |
bb_pos = 0; |
| 28 |
__init(i:number, bb:flatbuffers.ByteBuffer):Monster { |
| 29 |
this.bb_pos = i; |
| 30 |
this.bb = bb; |
| 31 |
return this; |
| 32 |
} |
| 33 |
|
| 34 |
static getRootAsMonster(bb:flatbuffers.ByteBuffer, obj?:Monster):Monster { |
| 35 |
return (obj || new Monster()).__init(bb.readInt32(bb.position()) + bb.position(), bb); |
| 36 |
} |
| 37 |
|
| 38 |
static getSizePrefixedRootAsMonster(bb:flatbuffers.ByteBuffer, obj?:Monster):Monster { |
| 39 |
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); |
| 40 |
return (obj || new Monster()).__init(bb.readInt32(bb.position()) + bb.position(), bb); |
| 41 |
} |
| 42 |
|
| 43 |
static bufferHasIdentifier(bb:flatbuffers.ByteBuffer):boolean { |
| 44 |
return bb.__has_identifier('MONS'); |
| 45 |
} |
| 46 |
|
| 47 |
pos(obj?:Vec3):Vec3|null { |
| 48 |
const offset = this.bb!.__offset(this.bb_pos, 4); |
| 49 |
return offset ? (obj || new Vec3()).__init(this.bb_pos + offset, this.bb!) : null; |
| 50 |
} |
| 51 |
|
| 52 |
mana():number { |
| 53 |
const offset = this.bb!.__offset(this.bb_pos, 6); |
| 54 |
return offset ? this.bb!.readInt16(this.bb_pos + offset) : 150; |
| 55 |
} |
| 56 |
|
| 57 |
mutate_mana(value:number):boolean { |
| 58 |
const offset = this.bb!.__offset(this.bb_pos, 6); |
| 59 |
|
| 60 |
if (offset === 0) { |
| 61 |
return false; |
| 62 |
} |
| 63 |
|
| 64 |
this.bb!.writeInt16(this.bb_pos + offset, value); |
| 65 |
return true; |
| 66 |
} |
| 67 |
|
| 68 |
hp():number { |
| 69 |
const offset = this.bb!.__offset(this.bb_pos, 8); |
| 70 |
return offset ? this.bb!.readInt16(this.bb_pos + offset) : 100; |
| 71 |
} |
| 72 |
|
| 73 |
mutate_hp(value:number):boolean { |
| 74 |
const offset = this.bb!.__offset(this.bb_pos, 8); |
| 75 |
|
| 76 |
if (offset === 0) { |
| 77 |
return false; |
| 78 |
} |
| 79 |
|
| 80 |
this.bb!.writeInt16(this.bb_pos + offset, value); |
| 81 |
return true; |
| 82 |
} |
| 83 |
|
| 84 |
name():string|null |
| 85 |
name(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null |
| 86 |
name(optionalEncoding?:any):string|Uint8Array|null { |
| 87 |
const offset = this.bb!.__offset(this.bb_pos, 10); |
| 88 |
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null; |
| 89 |
} |
| 90 |
|
| 91 |
inventory(index: number):number|null { |
| 92 |
const offset = this.bb!.__offset(this.bb_pos, 14); |
| 93 |
return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0; |
| 94 |
} |
| 95 |
|
| 96 |
inventoryLength():number { |
| 97 |
const offset = this.bb!.__offset(this.bb_pos, 14); |
| 98 |
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 99 |
} |
| 100 |
|
| 101 |
inventoryArray():Uint8Array|null { |
| 102 |
const offset = this.bb!.__offset(this.bb_pos, 14); |
| 103 |
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; |
| 104 |
} |
| 105 |
|
| 106 |
color():Color { |
| 107 |
const offset = this.bb!.__offset(this.bb_pos, 16); |
| 108 |
return offset ? this.bb!.readUint8(this.bb_pos + offset) : Color.Blue; |
| 109 |
} |
| 110 |
|
| 111 |
mutate_color(value:Color):boolean { |
| 112 |
const offset = this.bb!.__offset(this.bb_pos, 16); |
| 113 |
|
| 114 |
if (offset === 0) { |
| 115 |
return false; |
| 116 |
} |
| 117 |
|
| 118 |
this.bb!.writeUint8(this.bb_pos + offset, value); |
| 119 |
return true; |
| 120 |
} |
| 121 |
|
| 122 |
testType():Any { |
| 123 |
const offset = this.bb!.__offset(this.bb_pos, 18); |
| 124 |
return offset ? this.bb!.readUint8(this.bb_pos + offset) : Any.NONE; |
| 125 |
} |
| 126 |
|
| 127 |
test<T extends flatbuffers.Table>(obj:any):any|null { |
| 128 |
const offset = this.bb!.__offset(this.bb_pos, 20); |
| 129 |
return offset ? this.bb!.__union(obj, this.bb_pos + offset) : null; |
| 130 |
} |
| 131 |
|
| 132 |
test4(index: number, obj?:Test):Test|null { |
| 133 |
const offset = this.bb!.__offset(this.bb_pos, 22); |
| 134 |
return offset ? (obj || new Test()).__init(this.bb!.__vector(this.bb_pos + offset) + index * 4, this.bb!) : null; |
| 135 |
} |
| 136 |
|
| 137 |
test4Length():number { |
| 138 |
const offset = this.bb!.__offset(this.bb_pos, 22); |
| 139 |
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 140 |
} |
| 141 |
|
| 142 |
testarrayofstring(index: number):string |
| 143 |
testarrayofstring(index: number,optionalEncoding:flatbuffers.Encoding):string|Uint8Array |
| 144 |
testarrayofstring(index: number,optionalEncoding?:any):string|Uint8Array|null { |
| 145 |
const offset = this.bb!.__offset(this.bb_pos, 24); |
| 146 |
return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null; |
| 147 |
} |
| 148 |
|
| 149 |
testarrayofstringLength():number { |
| 150 |
const offset = this.bb!.__offset(this.bb_pos, 24); |
| 151 |
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 152 |
} |
| 153 |
|
| 154 |
/** |
| 155 |
* an example documentation comment: this will end up in the generated code |
| 156 |
* multiline too |
| 157 |
*/ |
| 158 |
testarrayoftables(index: number, obj?:Monster):Monster|null { |
| 159 |
const offset = this.bb!.__offset(this.bb_pos, 26); |
| 160 |
return offset ? (obj || new Monster()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null; |
| 161 |
} |
| 162 |
|
| 163 |
testarrayoftablesLength():number { |
| 164 |
const offset = this.bb!.__offset(this.bb_pos, 26); |
| 165 |
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 166 |
} |
| 167 |
|
| 168 |
enemy(obj?:Monster):Monster|null { |
| 169 |
const offset = this.bb!.__offset(this.bb_pos, 28); |
| 170 |
return offset ? (obj || new Monster()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null; |
| 171 |
} |
| 172 |
|
| 173 |
testnestedflatbuffer(index: number):number|null { |
| 174 |
const offset = this.bb!.__offset(this.bb_pos, 30); |
| 175 |
return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0; |
| 176 |
} |
| 177 |
|
| 178 |
testnestedflatbufferLength():number { |
| 179 |
const offset = this.bb!.__offset(this.bb_pos, 30); |
| 180 |
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 181 |
} |
| 182 |
|
| 183 |
testnestedflatbufferArray():Uint8Array|null { |
| 184 |
const offset = this.bb!.__offset(this.bb_pos, 30); |
| 185 |
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; |
| 186 |
} |
| 187 |
|
| 188 |
testempty(obj?:Stat):Stat|null { |
| 189 |
const offset = this.bb!.__offset(this.bb_pos, 32); |
| 190 |
return offset ? (obj || new Stat()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null; |
| 191 |
} |
| 192 |
|
| 193 |
testbool():boolean { |
| 194 |
const offset = this.bb!.__offset(this.bb_pos, 34); |
| 195 |
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false; |
| 196 |
} |
| 197 |
|
| 198 |
mutate_testbool(value:boolean):boolean { |
| 199 |
const offset = this.bb!.__offset(this.bb_pos, 34); |
| 200 |
|
| 201 |
if (offset === 0) { |
| 202 |
return false; |
| 203 |
} |
| 204 |
|
| 205 |
this.bb!.writeInt8(this.bb_pos + offset, +value); |
| 206 |
return true; |
| 207 |
} |
| 208 |
|
| 209 |
testhashs32Fnv1():number { |
| 210 |
const offset = this.bb!.__offset(this.bb_pos, 36); |
| 211 |
return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0; |
| 212 |
} |
| 213 |
|
| 214 |
mutate_testhashs32_fnv1(value:number):boolean { |
| 215 |
const offset = this.bb!.__offset(this.bb_pos, 36); |
| 216 |
|
| 217 |
if (offset === 0) { |
| 218 |
return false; |
| 219 |
} |
| 220 |
|
| 221 |
this.bb!.writeInt32(this.bb_pos + offset, value); |
| 222 |
return true; |
| 223 |
} |
| 224 |
|
| 225 |
testhashu32Fnv1():number { |
| 226 |
const offset = this.bb!.__offset(this.bb_pos, 38); |
| 227 |
return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0; |
| 228 |
} |
| 229 |
|
| 230 |
mutate_testhashu32_fnv1(value:number):boolean { |
| 231 |
const offset = this.bb!.__offset(this.bb_pos, 38); |
| 232 |
|
| 233 |
if (offset === 0) { |
| 234 |
return false; |
| 235 |
} |
| 236 |
|
| 237 |
this.bb!.writeUint32(this.bb_pos + offset, value); |
| 238 |
return true; |
| 239 |
} |
| 240 |
|
| 241 |
testhashs64Fnv1():bigint { |
| 242 |
const offset = this.bb!.__offset(this.bb_pos, 40); |
| 243 |
return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0'); |
| 244 |
} |
| 245 |
|
| 246 |
mutate_testhashs64_fnv1(value:bigint):boolean { |
| 247 |
const offset = this.bb!.__offset(this.bb_pos, 40); |
| 248 |
|
| 249 |
if (offset === 0) { |
| 250 |
return false; |
| 251 |
} |
| 252 |
|
| 253 |
this.bb!.writeInt64(this.bb_pos + offset, value); |
| 254 |
return true; |
| 255 |
} |
| 256 |
|
| 257 |
testhashu64Fnv1():bigint { |
| 258 |
const offset = this.bb!.__offset(this.bb_pos, 42); |
| 259 |
return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0'); |
| 260 |
} |
| 261 |
|
| 262 |
mutate_testhashu64_fnv1(value:bigint):boolean { |
| 263 |
const offset = this.bb!.__offset(this.bb_pos, 42); |
| 264 |
|
| 265 |
if (offset === 0) { |
| 266 |
return false; |
| 267 |
} |
| 268 |
|
| 269 |
this.bb!.writeUint64(this.bb_pos + offset, value); |
| 270 |
return true; |
| 271 |
} |
| 272 |
|
| 273 |
testhashs32Fnv1a():number { |
| 274 |
const offset = this.bb!.__offset(this.bb_pos, 44); |
| 275 |
return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0; |
| 276 |
} |
| 277 |
|
| 278 |
mutate_testhashs32_fnv1a(value:number):boolean { |
| 279 |
const offset = this.bb!.__offset(this.bb_pos, 44); |
| 280 |
|
| 281 |
if (offset === 0) { |
| 282 |
return false; |
| 283 |
} |
| 284 |
|
| 285 |
this.bb!.writeInt32(this.bb_pos + offset, value); |
| 286 |
return true; |
| 287 |
} |
| 288 |
|
| 289 |
testhashu32Fnv1a():number { |
| 290 |
const offset = this.bb!.__offset(this.bb_pos, 46); |
| 291 |
return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0; |
| 292 |
} |
| 293 |
|
| 294 |
mutate_testhashu32_fnv1a(value:number):boolean { |
| 295 |
const offset = this.bb!.__offset(this.bb_pos, 46); |
| 296 |
|
| 297 |
if (offset === 0) { |
| 298 |
return false; |
| 299 |
} |
| 300 |
|
| 301 |
this.bb!.writeUint32(this.bb_pos + offset, value); |
| 302 |
return true; |
| 303 |
} |
| 304 |
|
| 305 |
testhashs64Fnv1a():bigint { |
| 306 |
const offset = this.bb!.__offset(this.bb_pos, 48); |
| 307 |
return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0'); |
| 308 |
} |
| 309 |
|
| 310 |
mutate_testhashs64_fnv1a(value:bigint):boolean { |
| 311 |
const offset = this.bb!.__offset(this.bb_pos, 48); |
| 312 |
|
| 313 |
if (offset === 0) { |
| 314 |
return false; |
| 315 |
} |
| 316 |
|
| 317 |
this.bb!.writeInt64(this.bb_pos + offset, value); |
| 318 |
return true; |
| 319 |
} |
| 320 |
|
| 321 |
testhashu64Fnv1a():bigint { |
| 322 |
const offset = this.bb!.__offset(this.bb_pos, 50); |
| 323 |
return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0'); |
| 324 |
} |
| 325 |
|
| 326 |
mutate_testhashu64_fnv1a(value:bigint):boolean { |
| 327 |
const offset = this.bb!.__offset(this.bb_pos, 50); |
| 328 |
|
| 329 |
if (offset === 0) { |
| 330 |
return false; |
| 331 |
} |
| 332 |
|
| 333 |
this.bb!.writeUint64(this.bb_pos + offset, value); |
| 334 |
return true; |
| 335 |
} |
| 336 |
|
| 337 |
testarrayofbools(index: number):boolean|null { |
| 338 |
const offset = this.bb!.__offset(this.bb_pos, 52); |
| 339 |
return offset ? !!this.bb!.readInt8(this.bb!.__vector(this.bb_pos + offset) + index) : false; |
| 340 |
} |
| 341 |
|
| 342 |
testarrayofboolsLength():number { |
| 343 |
const offset = this.bb!.__offset(this.bb_pos, 52); |
| 344 |
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 345 |
} |
| 346 |
|
| 347 |
testarrayofboolsArray():Int8Array|null { |
| 348 |
const offset = this.bb!.__offset(this.bb_pos, 52); |
| 349 |
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; |
| 350 |
} |
| 351 |
|
| 352 |
testf():number { |
| 353 |
const offset = this.bb!.__offset(this.bb_pos, 54); |
| 354 |
return offset ? this.bb!.readFloat32(this.bb_pos + offset) : 3.14159; |
| 355 |
} |
| 356 |
|
| 357 |
mutate_testf(value:number):boolean { |
| 358 |
const offset = this.bb!.__offset(this.bb_pos, 54); |
| 359 |
|
| 360 |
if (offset === 0) { |
| 361 |
return false; |
| 362 |
} |
| 363 |
|
| 364 |
this.bb!.writeFloat32(this.bb_pos + offset, value); |
| 365 |
return true; |
| 366 |
} |
| 367 |
|
| 368 |
testf2():number { |
| 369 |
const offset = this.bb!.__offset(this.bb_pos, 56); |
| 370 |
return offset ? this.bb!.readFloat32(this.bb_pos + offset) : 3.0; |
| 371 |
} |
| 372 |
|
| 373 |
mutate_testf2(value:number):boolean { |
| 374 |
const offset = this.bb!.__offset(this.bb_pos, 56); |
| 375 |
|
| 376 |
if (offset === 0) { |
| 377 |
return false; |
| 378 |
} |
| 379 |
|
| 380 |
this.bb!.writeFloat32(this.bb_pos + offset, value); |
| 381 |
return true; |
| 382 |
} |
| 383 |
|
| 384 |
testf3():number { |
| 385 |
const offset = this.bb!.__offset(this.bb_pos, 58); |
| 386 |
return offset ? this.bb!.readFloat32(this.bb_pos + offset) : 0.0; |
| 387 |
} |
| 388 |
|
| 389 |
mutate_testf3(value:number):boolean { |
| 390 |
const offset = this.bb!.__offset(this.bb_pos, 58); |
| 391 |
|
| 392 |
if (offset === 0) { |
| 393 |
return false; |
| 394 |
} |
| 395 |
|
| 396 |
this.bb!.writeFloat32(this.bb_pos + offset, value); |
| 397 |
return true; |
| 398 |
} |
| 399 |
|
| 400 |
testarrayofstring2(index: number):string |
| 401 |
testarrayofstring2(index: number,optionalEncoding:flatbuffers.Encoding):string|Uint8Array |
| 402 |
testarrayofstring2(index: number,optionalEncoding?:any):string|Uint8Array|null { |
| 403 |
const offset = this.bb!.__offset(this.bb_pos, 60); |
| 404 |
return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null; |
| 405 |
} |
| 406 |
|
| 407 |
testarrayofstring2Length():number { |
| 408 |
const offset = this.bb!.__offset(this.bb_pos, 60); |
| 409 |
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 410 |
} |
| 411 |
|
| 412 |
testarrayofsortedstruct(index: number, obj?:Ability):Ability|null { |
| 413 |
const offset = this.bb!.__offset(this.bb_pos, 62); |
| 414 |
return offset ? (obj || new Ability()).__init(this.bb!.__vector(this.bb_pos + offset) + index * 8, this.bb!) : null; |
| 415 |
} |
| 416 |
|
| 417 |
testarrayofsortedstructLength():number { |
| 418 |
const offset = this.bb!.__offset(this.bb_pos, 62); |
| 419 |
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 420 |
} |
| 421 |
|
| 422 |
flex(index: number):number|null { |
| 423 |
const offset = this.bb!.__offset(this.bb_pos, 64); |
| 424 |
return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0; |
| 425 |
} |
| 426 |
|
| 427 |
flexLength():number { |
| 428 |
const offset = this.bb!.__offset(this.bb_pos, 64); |
| 429 |
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 430 |
} |
| 431 |
|
| 432 |
flexArray():Uint8Array|null { |
| 433 |
const offset = this.bb!.__offset(this.bb_pos, 64); |
| 434 |
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; |
| 435 |
} |
| 436 |
|
| 437 |
test5(index: number, obj?:Test):Test|null { |
| 438 |
const offset = this.bb!.__offset(this.bb_pos, 66); |
| 439 |
return offset ? (obj || new Test()).__init(this.bb!.__vector(this.bb_pos + offset) + index * 4, this.bb!) : null; |
| 440 |
} |
| 441 |
|
| 442 |
test5Length():number { |
| 443 |
const offset = this.bb!.__offset(this.bb_pos, 66); |
| 444 |
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 445 |
} |
| 446 |
|
| 447 |
vectorOfLongs(index: number):bigint|null { |
| 448 |
const offset = this.bb!.__offset(this.bb_pos, 68); |
| 449 |
return offset ? this.bb!.readInt64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : BigInt(0); |
| 450 |
} |
| 451 |
|
| 452 |
vectorOfLongsLength():number { |
| 453 |
const offset = this.bb!.__offset(this.bb_pos, 68); |
| 454 |
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 455 |
} |
| 456 |
|
| 457 |
vectorOfDoubles(index: number):number|null { |
| 458 |
const offset = this.bb!.__offset(this.bb_pos, 70); |
| 459 |
return offset ? this.bb!.readFloat64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : 0; |
| 460 |
} |
| 461 |
|
| 462 |
vectorOfDoublesLength():number { |
| 463 |
const offset = this.bb!.__offset(this.bb_pos, 70); |
| 464 |
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 465 |
} |
| 466 |
|
| 467 |
vectorOfDoublesArray():Float64Array|null { |
| 468 |
const offset = this.bb!.__offset(this.bb_pos, 70); |
| 469 |
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; |
| 470 |
} |
| 471 |
|
| 472 |
parentNamespaceTest(obj?:InParentNamespace):InParentNamespace|null { |
| 473 |
const offset = this.bb!.__offset(this.bb_pos, 72); |
| 474 |
return offset ? (obj || new InParentNamespace()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null; |
| 475 |
} |
| 476 |
|
| 477 |
vectorOfReferrables(index: number, obj?:Referrable):Referrable|null { |
| 478 |
const offset = this.bb!.__offset(this.bb_pos, 74); |
| 479 |
return offset ? (obj || new Referrable()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null; |
| 480 |
} |
| 481 |
|
| 482 |
vectorOfReferrablesLength():number { |
| 483 |
const offset = this.bb!.__offset(this.bb_pos, 74); |
| 484 |
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 485 |
} |
| 486 |
|
| 487 |
singleWeakReference():bigint { |
| 488 |
const offset = this.bb!.__offset(this.bb_pos, 76); |
| 489 |
return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0'); |
| 490 |
} |
| 491 |
|
| 492 |
mutate_single_weak_reference(value:bigint):boolean { |
| 493 |
const offset = this.bb!.__offset(this.bb_pos, 76); |
| 494 |
|
| 495 |
if (offset === 0) { |
| 496 |
return false; |
| 497 |
} |
| 498 |
|
| 499 |
this.bb!.writeUint64(this.bb_pos + offset, value); |
| 500 |
return true; |
| 501 |
} |
| 502 |
|
| 503 |
vectorOfWeakReferences(index: number):bigint|null { |
| 504 |
const offset = this.bb!.__offset(this.bb_pos, 78); |
| 505 |
return offset ? this.bb!.readUint64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : BigInt(0); |
| 506 |
} |
| 507 |
|
| 508 |
vectorOfWeakReferencesLength():number { |
| 509 |
const offset = this.bb!.__offset(this.bb_pos, 78); |
| 510 |
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 511 |
} |
| 512 |
|
| 513 |
vectorOfStrongReferrables(index: number, obj?:Referrable):Referrable|null { |
| 514 |
const offset = this.bb!.__offset(this.bb_pos, 80); |
| 515 |
return offset ? (obj || new Referrable()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null; |
| 516 |
} |
| 517 |
|
| 518 |
vectorOfStrongReferrablesLength():number { |
| 519 |
const offset = this.bb!.__offset(this.bb_pos, 80); |
| 520 |
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 521 |
} |
| 522 |
|
| 523 |
coOwningReference():bigint { |
| 524 |
const offset = this.bb!.__offset(this.bb_pos, 82); |
| 525 |
return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0'); |
| 526 |
} |
| 527 |
|
| 528 |
mutate_co_owning_reference(value:bigint):boolean { |
| 529 |
const offset = this.bb!.__offset(this.bb_pos, 82); |
| 530 |
|
| 531 |
if (offset === 0) { |
| 532 |
return false; |
| 533 |
} |
| 534 |
|
| 535 |
this.bb!.writeUint64(this.bb_pos + offset, value); |
| 536 |
return true; |
| 537 |
} |
| 538 |
|
| 539 |
vectorOfCoOwningReferences(index: number):bigint|null { |
| 540 |
const offset = this.bb!.__offset(this.bb_pos, 84); |
| 541 |
return offset ? this.bb!.readUint64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : BigInt(0); |
| 542 |
} |
| 543 |
|
| 544 |
vectorOfCoOwningReferencesLength():number { |
| 545 |
const offset = this.bb!.__offset(this.bb_pos, 84); |
| 546 |
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 547 |
} |
| 548 |
|
| 549 |
nonOwningReference():bigint { |
| 550 |
const offset = this.bb!.__offset(this.bb_pos, 86); |
| 551 |
return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0'); |
| 552 |
} |
| 553 |
|
| 554 |
mutate_non_owning_reference(value:bigint):boolean { |
| 555 |
const offset = this.bb!.__offset(this.bb_pos, 86); |
| 556 |
|
| 557 |
if (offset === 0) { |
| 558 |
return false; |
| 559 |
} |
| 560 |
|
| 561 |
this.bb!.writeUint64(this.bb_pos + offset, value); |
| 562 |
return true; |
| 563 |
} |
| 564 |
|
| 565 |
vectorOfNonOwningReferences(index: number):bigint|null { |
| 566 |
const offset = this.bb!.__offset(this.bb_pos, 88); |
| 567 |
return offset ? this.bb!.readUint64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : BigInt(0); |
| 568 |
} |
| 569 |
|
| 570 |
vectorOfNonOwningReferencesLength():number { |
| 571 |
const offset = this.bb!.__offset(this.bb_pos, 88); |
| 572 |
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 573 |
} |
| 574 |
|
| 575 |
anyUniqueType():AnyUniqueAliases { |
| 576 |
const offset = this.bb!.__offset(this.bb_pos, 90); |
| 577 |
return offset ? this.bb!.readUint8(this.bb_pos + offset) : AnyUniqueAliases.NONE; |
| 578 |
} |
| 579 |
|
| 580 |
anyUnique<T extends flatbuffers.Table>(obj:any):any|null { |
| 581 |
const offset = this.bb!.__offset(this.bb_pos, 92); |
| 582 |
return offset ? this.bb!.__union(obj, this.bb_pos + offset) : null; |
| 583 |
} |
| 584 |
|
| 585 |
anyAmbiguousType():AnyAmbiguousAliases { |
| 586 |
const offset = this.bb!.__offset(this.bb_pos, 94); |
| 587 |
return offset ? this.bb!.readUint8(this.bb_pos + offset) : AnyAmbiguousAliases.NONE; |
| 588 |
} |
| 589 |
|
| 590 |
anyAmbiguous<T extends flatbuffers.Table>(obj:any):any|null { |
| 591 |
const offset = this.bb!.__offset(this.bb_pos, 96); |
| 592 |
return offset ? this.bb!.__union(obj, this.bb_pos + offset) : null; |
| 593 |
} |
| 594 |
|
| 595 |
vectorOfEnums(index: number):Color|null { |
| 596 |
const offset = this.bb!.__offset(this.bb_pos, 98); |
| 597 |
return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0; |
| 598 |
} |
| 599 |
|
| 600 |
vectorOfEnumsLength():number { |
| 601 |
const offset = this.bb!.__offset(this.bb_pos, 98); |
| 602 |
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 603 |
} |
| 604 |
|
| 605 |
vectorOfEnumsArray():Uint8Array|null { |
| 606 |
const offset = this.bb!.__offset(this.bb_pos, 98); |
| 607 |
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; |
| 608 |
} |
| 609 |
|
| 610 |
signedEnum():Race { |
| 611 |
const offset = this.bb!.__offset(this.bb_pos, 100); |
| 612 |
return offset ? this.bb!.readInt8(this.bb_pos + offset) : Race.None; |
| 613 |
} |
| 614 |
|
| 615 |
mutate_signed_enum(value:Race):boolean { |
| 616 |
const offset = this.bb!.__offset(this.bb_pos, 100); |
| 617 |
|
| 618 |
if (offset === 0) { |
| 619 |
return false; |
| 620 |
} |
| 621 |
|
| 622 |
this.bb!.writeInt8(this.bb_pos + offset, value); |
| 623 |
return true; |
| 624 |
} |
| 625 |
|
| 626 |
testrequirednestedflatbuffer(index: number):number|null { |
| 627 |
const offset = this.bb!.__offset(this.bb_pos, 102); |
| 628 |
return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0; |
| 629 |
} |
| 630 |
|
| 631 |
testrequirednestedflatbufferLength():number { |
| 632 |
const offset = this.bb!.__offset(this.bb_pos, 102); |
| 633 |
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 634 |
} |
| 635 |
|
| 636 |
testrequirednestedflatbufferArray():Uint8Array|null { |
| 637 |
const offset = this.bb!.__offset(this.bb_pos, 102); |
| 638 |
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; |
| 639 |
} |
| 640 |
|
| 641 |
scalarKeySortedTables(index: number, obj?:Stat):Stat|null { |
| 642 |
const offset = this.bb!.__offset(this.bb_pos, 104); |
| 643 |
return offset ? (obj || new Stat()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null; |
| 644 |
} |
| 645 |
|
| 646 |
scalarKeySortedTablesLength():number { |
| 647 |
const offset = this.bb!.__offset(this.bb_pos, 104); |
| 648 |
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 649 |
} |
| 650 |
|
| 651 |
nativeInline(obj?:Test):Test|null { |
| 652 |
const offset = this.bb!.__offset(this.bb_pos, 106); |
| 653 |
return offset ? (obj || new Test()).__init(this.bb_pos + offset, this.bb!) : null; |
| 654 |
} |
| 655 |
|
| 656 |
longEnumNonEnumDefault():bigint { |
| 657 |
const offset = this.bb!.__offset(this.bb_pos, 108); |
| 658 |
return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0'); |
| 659 |
} |
| 660 |
|
| 661 |
mutate_long_enum_non_enum_default(value:bigint):boolean { |
| 662 |
const offset = this.bb!.__offset(this.bb_pos, 108); |
| 663 |
|
| 664 |
if (offset === 0) { |
| 665 |
return false; |
| 666 |
} |
| 667 |
|
| 668 |
this.bb!.writeUint64(this.bb_pos + offset, value); |
| 669 |
return true; |
| 670 |
} |
| 671 |
|
| 672 |
longEnumNormalDefault():bigint { |
| 673 |
const offset = this.bb!.__offset(this.bb_pos, 110); |
| 674 |
return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('2'); |
| 675 |
} |
| 676 |
|
| 677 |
mutate_long_enum_normal_default(value:bigint):boolean { |
| 678 |
const offset = this.bb!.__offset(this.bb_pos, 110); |
| 679 |
|
| 680 |
if (offset === 0) { |
| 681 |
return false; |
| 682 |
} |
| 683 |
|
| 684 |
this.bb!.writeUint64(this.bb_pos + offset, value); |
| 685 |
return true; |
| 686 |
} |
| 687 |
|
| 688 |
nanDefault():number { |
| 689 |
const offset = this.bb!.__offset(this.bb_pos, 112); |
| 690 |
return offset ? this.bb!.readFloat32(this.bb_pos + offset) : NaN; |
| 691 |
} |
| 692 |
|
| 693 |
mutate_nan_default(value:number):boolean { |
| 694 |
const offset = this.bb!.__offset(this.bb_pos, 112); |
| 695 |
|
| 696 |
if (offset === 0) { |
| 697 |
return false; |
| 698 |
} |
| 699 |
|
| 700 |
this.bb!.writeFloat32(this.bb_pos + offset, value); |
| 701 |
return true; |
| 702 |
} |
| 703 |
|
| 704 |
infDefault():number { |
| 705 |
const offset = this.bb!.__offset(this.bb_pos, 114); |
| 706 |
return offset ? this.bb!.readFloat32(this.bb_pos + offset) : Infinity; |
| 707 |
} |
| 708 |
|
| 709 |
mutate_inf_default(value:number):boolean { |
| 710 |
const offset = this.bb!.__offset(this.bb_pos, 114); |
| 711 |
|
| 712 |
if (offset === 0) { |
| 713 |
return false; |
| 714 |
} |
| 715 |
|
| 716 |
this.bb!.writeFloat32(this.bb_pos + offset, value); |
| 717 |
return true; |
| 718 |
} |
| 719 |
|
| 720 |
positiveInfDefault():number { |
| 721 |
const offset = this.bb!.__offset(this.bb_pos, 116); |
| 722 |
return offset ? this.bb!.readFloat32(this.bb_pos + offset) : Infinity; |
| 723 |
} |
| 724 |
|
| 725 |
mutate_positive_inf_default(value:number):boolean { |
| 726 |
const offset = this.bb!.__offset(this.bb_pos, 116); |
| 727 |
|
| 728 |
if (offset === 0) { |
| 729 |
return false; |
| 730 |
} |
| 731 |
|
| 732 |
this.bb!.writeFloat32(this.bb_pos + offset, value); |
| 733 |
return true; |
| 734 |
} |
| 735 |
|
| 736 |
infinityDefault():number { |
| 737 |
const offset = this.bb!.__offset(this.bb_pos, 118); |
| 738 |
return offset ? this.bb!.readFloat32(this.bb_pos + offset) : Infinity; |
| 739 |
} |
| 740 |
|
| 741 |
mutate_infinity_default(value:number):boolean { |
| 742 |
const offset = this.bb!.__offset(this.bb_pos, 118); |
| 743 |
|
| 744 |
if (offset === 0) { |
| 745 |
return false; |
| 746 |
} |
| 747 |
|
| 748 |
this.bb!.writeFloat32(this.bb_pos + offset, value); |
| 749 |
return true; |
| 750 |
} |
| 751 |
|
| 752 |
positiveInfinityDefault():number { |
| 753 |
const offset = this.bb!.__offset(this.bb_pos, 120); |
| 754 |
return offset ? this.bb!.readFloat32(this.bb_pos + offset) : Infinity; |
| 755 |
} |
| 756 |
|
| 757 |
mutate_positive_infinity_default(value:number):boolean { |
| 758 |
const offset = this.bb!.__offset(this.bb_pos, 120); |
| 759 |
|
| 760 |
if (offset === 0) { |
| 761 |
return false; |
| 762 |
} |
| 763 |
|
| 764 |
this.bb!.writeFloat32(this.bb_pos + offset, value); |
| 765 |
return true; |
| 766 |
} |
| 767 |
|
| 768 |
negativeInfDefault():number { |
| 769 |
const offset = this.bb!.__offset(this.bb_pos, 122); |
| 770 |
return offset ? this.bb!.readFloat32(this.bb_pos + offset) : -Infinity; |
| 771 |
} |
| 772 |
|
| 773 |
mutate_negative_inf_default(value:number):boolean { |
| 774 |
const offset = this.bb!.__offset(this.bb_pos, 122); |
| 775 |
|
| 776 |
if (offset === 0) { |
| 777 |
return false; |
| 778 |
} |
| 779 |
|
| 780 |
this.bb!.writeFloat32(this.bb_pos + offset, value); |
| 781 |
return true; |
| 782 |
} |
| 783 |
|
| 784 |
negativeInfinityDefault():number { |
| 785 |
const offset = this.bb!.__offset(this.bb_pos, 124); |
| 786 |
return offset ? this.bb!.readFloat32(this.bb_pos + offset) : -Infinity; |
| 787 |
} |
| 788 |
|
| 789 |
mutate_negative_infinity_default(value:number):boolean { |
| 790 |
const offset = this.bb!.__offset(this.bb_pos, 124); |
| 791 |
|
| 792 |
if (offset === 0) { |
| 793 |
return false; |
| 794 |
} |
| 795 |
|
| 796 |
this.bb!.writeFloat32(this.bb_pos + offset, value); |
| 797 |
return true; |
| 798 |
} |
| 799 |
|
| 800 |
doubleInfDefault():number { |
| 801 |
const offset = this.bb!.__offset(this.bb_pos, 126); |
| 802 |
return offset ? this.bb!.readFloat64(this.bb_pos + offset) : Infinity; |
| 803 |
} |
| 804 |
|
| 805 |
mutate_double_inf_default(value:number):boolean { |
| 806 |
const offset = this.bb!.__offset(this.bb_pos, 126); |
| 807 |
|
| 808 |
if (offset === 0) { |
| 809 |
return false; |
| 810 |
} |
| 811 |
|
| 812 |
this.bb!.writeFloat64(this.bb_pos + offset, value); |
| 813 |
return true; |
| 814 |
} |
| 815 |
|
| 816 |
static getFullyQualifiedName():string { |
| 817 |
return 'MyGame.Example.Monster'; |
| 818 |
} |
| 819 |
|
| 820 |
static startMonster(builder:flatbuffers.Builder) { |
| 821 |
builder.startObject(62); |
| 822 |
} |
| 823 |
|
| 824 |
static addPos(builder:flatbuffers.Builder, posOffset:flatbuffers.Offset) { |
| 825 |
builder.addFieldStruct(0, posOffset, 0); |
| 826 |
} |
| 827 |
|
| 828 |
static addMana(builder:flatbuffers.Builder, mana:number) { |
| 829 |
builder.addFieldInt16(1, mana, 150); |
| 830 |
} |
| 831 |
|
| 832 |
static addHp(builder:flatbuffers.Builder, hp:number) { |
| 833 |
builder.addFieldInt16(2, hp, 100); |
| 834 |
} |
| 835 |
|
| 836 |
static addName(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset) { |
| 837 |
builder.addFieldOffset(3, nameOffset, 0); |
| 838 |
} |
| 839 |
|
| 840 |
static addInventory(builder:flatbuffers.Builder, inventoryOffset:flatbuffers.Offset) { |
| 841 |
builder.addFieldOffset(5, inventoryOffset, 0); |
| 842 |
} |
| 843 |
|
| 844 |
static createInventoryVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset { |
| 845 |
builder.startVector(1, data.length, 1); |
| 846 |
for (let i = data.length - 1; i >= 0; i--) { |
| 847 |
builder.addInt8(data[i]!); |
| 848 |
} |
| 849 |
return builder.endVector(); |
| 850 |
} |
| 851 |
|
| 852 |
static startInventoryVector(builder:flatbuffers.Builder, numElems:number) { |
| 853 |
builder.startVector(1, numElems, 1); |
| 854 |
} |
| 855 |
|
| 856 |
static addColor(builder:flatbuffers.Builder, color:Color) { |
| 857 |
builder.addFieldInt8(6, color, Color.Blue); |
| 858 |
} |
| 859 |
|
| 860 |
static addTestType(builder:flatbuffers.Builder, testType:Any) { |
| 861 |
builder.addFieldInt8(7, testType, Any.NONE); |
| 862 |
} |
| 863 |
|
| 864 |
static addTest(builder:flatbuffers.Builder, testOffset:flatbuffers.Offset) { |
| 865 |
builder.addFieldOffset(8, testOffset, 0); |
| 866 |
} |
| 867 |
|
| 868 |
static addTest4(builder:flatbuffers.Builder, test4Offset:flatbuffers.Offset) { |
| 869 |
builder.addFieldOffset(9, test4Offset, 0); |
| 870 |
} |
| 871 |
|
| 872 |
static startTest4Vector(builder:flatbuffers.Builder, numElems:number) { |
| 873 |
builder.startVector(4, numElems, 2); |
| 874 |
} |
| 875 |
|
| 876 |
static addTestarrayofstring(builder:flatbuffers.Builder, testarrayofstringOffset:flatbuffers.Offset) { |
| 877 |
builder.addFieldOffset(10, testarrayofstringOffset, 0); |
| 878 |
} |
| 879 |
|
| 880 |
static createTestarrayofstringVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset { |
| 881 |
builder.startVector(4, data.length, 4); |
| 882 |
for (let i = data.length - 1; i >= 0; i--) { |
| 883 |
builder.addOffset(data[i]!); |
| 884 |
} |
| 885 |
return builder.endVector(); |
| 886 |
} |
| 887 |
|
| 888 |
static startTestarrayofstringVector(builder:flatbuffers.Builder, numElems:number) { |
| 889 |
builder.startVector(4, numElems, 4); |
| 890 |
} |
| 891 |
|
| 892 |
static addTestarrayoftables(builder:flatbuffers.Builder, testarrayoftablesOffset:flatbuffers.Offset) { |
| 893 |
builder.addFieldOffset(11, testarrayoftablesOffset, 0); |
| 894 |
} |
| 895 |
|
| 896 |
static createTestarrayoftablesVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset { |
| 897 |
builder.startVector(4, data.length, 4); |
| 898 |
for (let i = data.length - 1; i >= 0; i--) { |
| 899 |
builder.addOffset(data[i]!); |
| 900 |
} |
| 901 |
return builder.endVector(); |
| 902 |
} |
| 903 |
|
| 904 |
static startTestarrayoftablesVector(builder:flatbuffers.Builder, numElems:number) { |
| 905 |
builder.startVector(4, numElems, 4); |
| 906 |
} |
| 907 |
|
| 908 |
static addEnemy(builder:flatbuffers.Builder, enemyOffset:flatbuffers.Offset) { |
| 909 |
builder.addFieldOffset(12, enemyOffset, 0); |
| 910 |
} |
| 911 |
|
| 912 |
static addTestnestedflatbuffer(builder:flatbuffers.Builder, testnestedflatbufferOffset:flatbuffers.Offset) { |
| 913 |
builder.addFieldOffset(13, testnestedflatbufferOffset, 0); |
| 914 |
} |
| 915 |
|
| 916 |
static createTestnestedflatbufferVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset { |
| 917 |
builder.startVector(1, data.length, 1); |
| 918 |
for (let i = data.length - 1; i >= 0; i--) { |
| 919 |
builder.addInt8(data[i]!); |
| 920 |
} |
| 921 |
return builder.endVector(); |
| 922 |
} |
| 923 |
|
| 924 |
static startTestnestedflatbufferVector(builder:flatbuffers.Builder, numElems:number) { |
| 925 |
builder.startVector(1, numElems, 1); |
| 926 |
} |
| 927 |
|
| 928 |
static addTestempty(builder:flatbuffers.Builder, testemptyOffset:flatbuffers.Offset) { |
| 929 |
builder.addFieldOffset(14, testemptyOffset, 0); |
| 930 |
} |
| 931 |
|
| 932 |
static addTestbool(builder:flatbuffers.Builder, testbool:boolean) { |
| 933 |
builder.addFieldInt8(15, +testbool, +false); |
| 934 |
} |
| 935 |
|
| 936 |
static addTesthashs32Fnv1(builder:flatbuffers.Builder, testhashs32Fnv1:number) { |
| 937 |
builder.addFieldInt32(16, testhashs32Fnv1, 0); |
| 938 |
} |
| 939 |
|
| 940 |
static addTesthashu32Fnv1(builder:flatbuffers.Builder, testhashu32Fnv1:number) { |
| 941 |
builder.addFieldInt32(17, testhashu32Fnv1, 0); |
| 942 |
} |
| 943 |
|
| 944 |
static addTesthashs64Fnv1(builder:flatbuffers.Builder, testhashs64Fnv1:bigint) { |
| 945 |
builder.addFieldInt64(18, testhashs64Fnv1, BigInt('0')); |
| 946 |
} |
| 947 |
|
| 948 |
static addTesthashu64Fnv1(builder:flatbuffers.Builder, testhashu64Fnv1:bigint) { |
| 949 |
builder.addFieldInt64(19, testhashu64Fnv1, BigInt('0')); |
| 950 |
} |
| 951 |
|
| 952 |
static addTesthashs32Fnv1a(builder:flatbuffers.Builder, testhashs32Fnv1a:number) { |
| 953 |
builder.addFieldInt32(20, testhashs32Fnv1a, 0); |
| 954 |
} |
| 955 |
|
| 956 |
static addTesthashu32Fnv1a(builder:flatbuffers.Builder, testhashu32Fnv1a:number) { |
| 957 |
builder.addFieldInt32(21, testhashu32Fnv1a, 0); |
| 958 |
} |
| 959 |
|
| 960 |
static addTesthashs64Fnv1a(builder:flatbuffers.Builder, testhashs64Fnv1a:bigint) { |
| 961 |
builder.addFieldInt64(22, testhashs64Fnv1a, BigInt('0')); |
| 962 |
} |
| 963 |
|
| 964 |
static addTesthashu64Fnv1a(builder:flatbuffers.Builder, testhashu64Fnv1a:bigint) { |
| 965 |
builder.addFieldInt64(23, testhashu64Fnv1a, BigInt('0')); |
| 966 |
} |
| 967 |
|
| 968 |
static addTestarrayofbools(builder:flatbuffers.Builder, testarrayofboolsOffset:flatbuffers.Offset) { |
| 969 |
builder.addFieldOffset(24, testarrayofboolsOffset, 0); |
| 970 |
} |
| 971 |
|
| 972 |
static createTestarrayofboolsVector(builder:flatbuffers.Builder, data:boolean[]):flatbuffers.Offset { |
| 973 |
builder.startVector(1, data.length, 1); |
| 974 |
for (let i = data.length - 1; i >= 0; i--) { |
| 975 |
builder.addInt8(+data[i]!); |
| 976 |
} |
| 977 |
return builder.endVector(); |
| 978 |
} |
| 979 |
|
| 980 |
static startTestarrayofboolsVector(builder:flatbuffers.Builder, numElems:number) { |
| 981 |
builder.startVector(1, numElems, 1); |
| 982 |
} |
| 983 |
|
| 984 |
static addTestf(builder:flatbuffers.Builder, testf:number) { |
| 985 |
builder.addFieldFloat32(25, testf, 3.14159); |
| 986 |
} |
| 987 |
|
| 988 |
static addTestf2(builder:flatbuffers.Builder, testf2:number) { |
| 989 |
builder.addFieldFloat32(26, testf2, 3.0); |
| 990 |
} |
| 991 |
|
| 992 |
static addTestf3(builder:flatbuffers.Builder, testf3:number) { |
| 993 |
builder.addFieldFloat32(27, testf3, 0.0); |
| 994 |
} |
| 995 |
|
| 996 |
static addTestarrayofstring2(builder:flatbuffers.Builder, testarrayofstring2Offset:flatbuffers.Offset) { |
| 997 |
builder.addFieldOffset(28, testarrayofstring2Offset, 0); |
| 998 |
} |
| 999 |
|
| 1000 |
static createTestarrayofstring2Vector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset { |
| 1001 |
builder.startVector(4, data.length, 4); |
| 1002 |
for (let i = data.length - 1; i >= 0; i--) { |
| 1003 |
builder.addOffset(data[i]!); |
| 1004 |
} |
| 1005 |
return builder.endVector(); |
| 1006 |
} |
| 1007 |
|
| 1008 |
static startTestarrayofstring2Vector(builder:flatbuffers.Builder, numElems:number) { |
| 1009 |
builder.startVector(4, numElems, 4); |
| 1010 |
} |
| 1011 |
|
| 1012 |
static addTestarrayofsortedstruct(builder:flatbuffers.Builder, testarrayofsortedstructOffset:flatbuffers.Offset) { |
| 1013 |
builder.addFieldOffset(29, testarrayofsortedstructOffset, 0); |
| 1014 |
} |
| 1015 |
|
| 1016 |
static startTestarrayofsortedstructVector(builder:flatbuffers.Builder, numElems:number) { |
| 1017 |
builder.startVector(8, numElems, 4); |
| 1018 |
} |
| 1019 |
|
| 1020 |
static addFlex(builder:flatbuffers.Builder, flexOffset:flatbuffers.Offset) { |
| 1021 |
builder.addFieldOffset(30, flexOffset, 0); |
| 1022 |
} |
| 1023 |
|
| 1024 |
static createFlexVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset { |
| 1025 |
builder.startVector(1, data.length, 1); |
| 1026 |
for (let i = data.length - 1; i >= 0; i--) { |
| 1027 |
builder.addInt8(data[i]!); |
| 1028 |
} |
| 1029 |
return builder.endVector(); |
| 1030 |
} |
| 1031 |
|
| 1032 |
static startFlexVector(builder:flatbuffers.Builder, numElems:number) { |
| 1033 |
builder.startVector(1, numElems, 1); |
| 1034 |
} |
| 1035 |
|
| 1036 |
static addTest5(builder:flatbuffers.Builder, test5Offset:flatbuffers.Offset) { |
| 1037 |
builder.addFieldOffset(31, test5Offset, 0); |
| 1038 |
} |
| 1039 |
|
| 1040 |
static startTest5Vector(builder:flatbuffers.Builder, numElems:number) { |
| 1041 |
builder.startVector(4, numElems, 2); |
| 1042 |
} |
| 1043 |
|
| 1044 |
static addVectorOfLongs(builder:flatbuffers.Builder, vectorOfLongsOffset:flatbuffers.Offset) { |
| 1045 |
builder.addFieldOffset(32, vectorOfLongsOffset, 0); |
| 1046 |
} |
| 1047 |
|
| 1048 |
static createVectorOfLongsVector(builder:flatbuffers.Builder, data:bigint[]):flatbuffers.Offset { |
| 1049 |
builder.startVector(8, data.length, 8); |
| 1050 |
for (let i = data.length - 1; i >= 0; i--) { |
| 1051 |
builder.addInt64(data[i]!); |
| 1052 |
} |
| 1053 |
return builder.endVector(); |
| 1054 |
} |
| 1055 |
|
| 1056 |
static startVectorOfLongsVector(builder:flatbuffers.Builder, numElems:number) { |
| 1057 |
builder.startVector(8, numElems, 8); |
| 1058 |
} |
| 1059 |
|
| 1060 |
static addVectorOfDoubles(builder:flatbuffers.Builder, vectorOfDoublesOffset:flatbuffers.Offset) { |
| 1061 |
builder.addFieldOffset(33, vectorOfDoublesOffset, 0); |
| 1062 |
} |
| 1063 |
|
| 1064 |
static createVectorOfDoublesVector(builder:flatbuffers.Builder, data:number[]|Float64Array):flatbuffers.Offset; |
| 1065 |
/** |
| 1066 |
* @deprecated This Uint8Array overload will be removed in the future. |
| 1067 |
*/ |
| 1068 |
static createVectorOfDoublesVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset; |
| 1069 |
static createVectorOfDoublesVector(builder:flatbuffers.Builder, data:number[]|Float64Array|Uint8Array):flatbuffers.Offset { |
| 1070 |
builder.startVector(8, data.length, 8); |
| 1071 |
for (let i = data.length - 1; i >= 0; i--) { |
| 1072 |
builder.addFloat64(data[i]!); |
| 1073 |
} |
| 1074 |
return builder.endVector(); |
| 1075 |
} |
| 1076 |
|
| 1077 |
static startVectorOfDoublesVector(builder:flatbuffers.Builder, numElems:number) { |
| 1078 |
builder.startVector(8, numElems, 8); |
| 1079 |
} |
| 1080 |
|
| 1081 |
static addParentNamespaceTest(builder:flatbuffers.Builder, parentNamespaceTestOffset:flatbuffers.Offset) { |
| 1082 |
builder.addFieldOffset(34, parentNamespaceTestOffset, 0); |
| 1083 |
} |
| 1084 |
|
| 1085 |
static addVectorOfReferrables(builder:flatbuffers.Builder, vectorOfReferrablesOffset:flatbuffers.Offset) { |
| 1086 |
builder.addFieldOffset(35, vectorOfReferrablesOffset, 0); |
| 1087 |
} |
| 1088 |
|
| 1089 |
static createVectorOfReferrablesVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset { |
| 1090 |
builder.startVector(4, data.length, 4); |
| 1091 |
for (let i = data.length - 1; i >= 0; i--) { |
| 1092 |
builder.addOffset(data[i]!); |
| 1093 |
} |
| 1094 |
return builder.endVector(); |
| 1095 |
} |
| 1096 |
|
| 1097 |
static startVectorOfReferrablesVector(builder:flatbuffers.Builder, numElems:number) { |
| 1098 |
builder.startVector(4, numElems, 4); |
| 1099 |
} |
| 1100 |
|
| 1101 |
static addSingleWeakReference(builder:flatbuffers.Builder, singleWeakReference:bigint) { |
| 1102 |
builder.addFieldInt64(36, singleWeakReference, BigInt('0')); |
| 1103 |
} |
| 1104 |
|
| 1105 |
static addVectorOfWeakReferences(builder:flatbuffers.Builder, vectorOfWeakReferencesOffset:flatbuffers.Offset) { |
| 1106 |
builder.addFieldOffset(37, vectorOfWeakReferencesOffset, 0); |
| 1107 |
} |
| 1108 |
|
| 1109 |
static createVectorOfWeakReferencesVector(builder:flatbuffers.Builder, data:bigint[]):flatbuffers.Offset { |
| 1110 |
builder.startVector(8, data.length, 8); |
| 1111 |
for (let i = data.length - 1; i >= 0; i--) { |
| 1112 |
builder.addInt64(data[i]!); |
| 1113 |
} |
| 1114 |
return builder.endVector(); |
| 1115 |
} |
| 1116 |
|
| 1117 |
static startVectorOfWeakReferencesVector(builder:flatbuffers.Builder, numElems:number) { |
| 1118 |
builder.startVector(8, numElems, 8); |
| 1119 |
} |
| 1120 |
|
| 1121 |
static addVectorOfStrongReferrables(builder:flatbuffers.Builder, vectorOfStrongReferrablesOffset:flatbuffers.Offset) { |
| 1122 |
builder.addFieldOffset(38, vectorOfStrongReferrablesOffset, 0); |
| 1123 |
} |
| 1124 |
|
| 1125 |
static createVectorOfStrongReferrablesVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset { |
| 1126 |
builder.startVector(4, data.length, 4); |
| 1127 |
for (let i = data.length - 1; i >= 0; i--) { |
| 1128 |
builder.addOffset(data[i]!); |
| 1129 |
} |
| 1130 |
return builder.endVector(); |
| 1131 |
} |
| 1132 |
|
| 1133 |
static startVectorOfStrongReferrablesVector(builder:flatbuffers.Builder, numElems:number) { |
| 1134 |
builder.startVector(4, numElems, 4); |
| 1135 |
} |
| 1136 |
|
| 1137 |
static addCoOwningReference(builder:flatbuffers.Builder, coOwningReference:bigint) { |
| 1138 |
builder.addFieldInt64(39, coOwningReference, BigInt('0')); |
| 1139 |
} |
| 1140 |
|
| 1141 |
static addVectorOfCoOwningReferences(builder:flatbuffers.Builder, vectorOfCoOwningReferencesOffset:flatbuffers.Offset) { |
| 1142 |
builder.addFieldOffset(40, vectorOfCoOwningReferencesOffset, 0); |
| 1143 |
} |
| 1144 |
|
| 1145 |
static createVectorOfCoOwningReferencesVector(builder:flatbuffers.Builder, data:bigint[]):flatbuffers.Offset { |
| 1146 |
builder.startVector(8, data.length, 8); |
| 1147 |
for (let i = data.length - 1; i >= 0; i--) { |
| 1148 |
builder.addInt64(data[i]!); |
| 1149 |
} |
| 1150 |
return builder.endVector(); |
| 1151 |
} |
| 1152 |
|
| 1153 |
static startVectorOfCoOwningReferencesVector(builder:flatbuffers.Builder, numElems:number) { |
| 1154 |
builder.startVector(8, numElems, 8); |
| 1155 |
} |
| 1156 |
|
| 1157 |
static addNonOwningReference(builder:flatbuffers.Builder, nonOwningReference:bigint) { |
| 1158 |
builder.addFieldInt64(41, nonOwningReference, BigInt('0')); |
| 1159 |
} |
| 1160 |
|
| 1161 |
static addVectorOfNonOwningReferences(builder:flatbuffers.Builder, vectorOfNonOwningReferencesOffset:flatbuffers.Offset) { |
| 1162 |
builder.addFieldOffset(42, vectorOfNonOwningReferencesOffset, 0); |
| 1163 |
} |
| 1164 |
|
| 1165 |
static createVectorOfNonOwningReferencesVector(builder:flatbuffers.Builder, data:bigint[]):flatbuffers.Offset { |
| 1166 |
builder.startVector(8, data.length, 8); |
| 1167 |
for (let i = data.length - 1; i >= 0; i--) { |
| 1168 |
builder.addInt64(data[i]!); |
| 1169 |
} |
| 1170 |
return builder.endVector(); |
| 1171 |
} |
| 1172 |
|
| 1173 |
static startVectorOfNonOwningReferencesVector(builder:flatbuffers.Builder, numElems:number) { |
| 1174 |
builder.startVector(8, numElems, 8); |
| 1175 |
} |
| 1176 |
|
| 1177 |
static addAnyUniqueType(builder:flatbuffers.Builder, anyUniqueType:AnyUniqueAliases) { |
| 1178 |
builder.addFieldInt8(43, anyUniqueType, AnyUniqueAliases.NONE); |
| 1179 |
} |
| 1180 |
|
| 1181 |
static addAnyUnique(builder:flatbuffers.Builder, anyUniqueOffset:flatbuffers.Offset) { |
| 1182 |
builder.addFieldOffset(44, anyUniqueOffset, 0); |
| 1183 |
} |
| 1184 |
|
| 1185 |
static addAnyAmbiguousType(builder:flatbuffers.Builder, anyAmbiguousType:AnyAmbiguousAliases) { |
| 1186 |
builder.addFieldInt8(45, anyAmbiguousType, AnyAmbiguousAliases.NONE); |
| 1187 |
} |
| 1188 |
|
| 1189 |
static addAnyAmbiguous(builder:flatbuffers.Builder, anyAmbiguousOffset:flatbuffers.Offset) { |
| 1190 |
builder.addFieldOffset(46, anyAmbiguousOffset, 0); |
| 1191 |
} |
| 1192 |
|
| 1193 |
static addVectorOfEnums(builder:flatbuffers.Builder, vectorOfEnumsOffset:flatbuffers.Offset) { |
| 1194 |
builder.addFieldOffset(47, vectorOfEnumsOffset, 0); |
| 1195 |
} |
| 1196 |
|
| 1197 |
static createVectorOfEnumsVector(builder:flatbuffers.Builder, data:Color[]):flatbuffers.Offset { |
| 1198 |
builder.startVector(1, data.length, 1); |
| 1199 |
for (let i = data.length - 1; i >= 0; i--) { |
| 1200 |
builder.addInt8(data[i]!); |
| 1201 |
} |
| 1202 |
return builder.endVector(); |
| 1203 |
} |
| 1204 |
|
| 1205 |
static startVectorOfEnumsVector(builder:flatbuffers.Builder, numElems:number) { |
| 1206 |
builder.startVector(1, numElems, 1); |
| 1207 |
} |
| 1208 |
|
| 1209 |
static addSignedEnum(builder:flatbuffers.Builder, signedEnum:Race) { |
| 1210 |
builder.addFieldInt8(48, signedEnum, Race.None); |
| 1211 |
} |
| 1212 |
|
| 1213 |
static addTestrequirednestedflatbuffer(builder:flatbuffers.Builder, testrequirednestedflatbufferOffset:flatbuffers.Offset) { |
| 1214 |
builder.addFieldOffset(49, testrequirednestedflatbufferOffset, 0); |
| 1215 |
} |
| 1216 |
|
| 1217 |
static createTestrequirednestedflatbufferVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset { |
| 1218 |
builder.startVector(1, data.length, 1); |
| 1219 |
for (let i = data.length - 1; i >= 0; i--) { |
| 1220 |
builder.addInt8(data[i]!); |
| 1221 |
} |
| 1222 |
return builder.endVector(); |
| 1223 |
} |
| 1224 |
|
| 1225 |
static startTestrequirednestedflatbufferVector(builder:flatbuffers.Builder, numElems:number) { |
| 1226 |
builder.startVector(1, numElems, 1); |
| 1227 |
} |
| 1228 |
|
| 1229 |
static addScalarKeySortedTables(builder:flatbuffers.Builder, scalarKeySortedTablesOffset:flatbuffers.Offset) { |
| 1230 |
builder.addFieldOffset(50, scalarKeySortedTablesOffset, 0); |
| 1231 |
} |
| 1232 |
|
| 1233 |
static createScalarKeySortedTablesVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset { |
| 1234 |
builder.startVector(4, data.length, 4); |
| 1235 |
for (let i = data.length - 1; i >= 0; i--) { |
| 1236 |
builder.addOffset(data[i]!); |
| 1237 |
} |
| 1238 |
return builder.endVector(); |
| 1239 |
} |
| 1240 |
|
| 1241 |
static startScalarKeySortedTablesVector(builder:flatbuffers.Builder, numElems:number) { |
| 1242 |
builder.startVector(4, numElems, 4); |
| 1243 |
} |
| 1244 |
|
| 1245 |
static addNativeInline(builder:flatbuffers.Builder, nativeInlineOffset:flatbuffers.Offset) { |
| 1246 |
builder.addFieldStruct(51, nativeInlineOffset, 0); |
| 1247 |
} |
| 1248 |
|
| 1249 |
static addLongEnumNonEnumDefault(builder:flatbuffers.Builder, longEnumNonEnumDefault:bigint) { |
| 1250 |
builder.addFieldInt64(52, longEnumNonEnumDefault, BigInt('0')); |
| 1251 |
} |
| 1252 |
|
| 1253 |
static addLongEnumNormalDefault(builder:flatbuffers.Builder, longEnumNormalDefault:bigint) { |
| 1254 |
builder.addFieldInt64(53, longEnumNormalDefault, BigInt('2')); |
| 1255 |
} |
| 1256 |
|
| 1257 |
static addNanDefault(builder:flatbuffers.Builder, nanDefault:number) { |
| 1258 |
builder.addFieldFloat32(54, nanDefault, NaN); |
| 1259 |
} |
| 1260 |
|
| 1261 |
static addInfDefault(builder:flatbuffers.Builder, infDefault:number) { |
| 1262 |
builder.addFieldFloat32(55, infDefault, Infinity); |
| 1263 |
} |
| 1264 |
|
| 1265 |
static addPositiveInfDefault(builder:flatbuffers.Builder, positiveInfDefault:number) { |
| 1266 |
builder.addFieldFloat32(56, positiveInfDefault, Infinity); |
| 1267 |
} |
| 1268 |
|
| 1269 |
static addInfinityDefault(builder:flatbuffers.Builder, infinityDefault:number) { |
| 1270 |
builder.addFieldFloat32(57, infinityDefault, Infinity); |
| 1271 |
} |
| 1272 |
|
| 1273 |
static addPositiveInfinityDefault(builder:flatbuffers.Builder, positiveInfinityDefault:number) { |
| 1274 |
builder.addFieldFloat32(58, positiveInfinityDefault, Infinity); |
| 1275 |
} |
| 1276 |
|
| 1277 |
static addNegativeInfDefault(builder:flatbuffers.Builder, negativeInfDefault:number) { |
| 1278 |
builder.addFieldFloat32(59, negativeInfDefault, -Infinity); |
| 1279 |
} |
| 1280 |
|
| 1281 |
static addNegativeInfinityDefault(builder:flatbuffers.Builder, negativeInfinityDefault:number) { |
| 1282 |
builder.addFieldFloat32(60, negativeInfinityDefault, -Infinity); |
| 1283 |
} |
| 1284 |
|
| 1285 |
static addDoubleInfDefault(builder:flatbuffers.Builder, doubleInfDefault:number) { |
| 1286 |
builder.addFieldFloat64(61, doubleInfDefault, Infinity); |
| 1287 |
} |
| 1288 |
|
| 1289 |
static endMonster(builder:flatbuffers.Builder):flatbuffers.Offset { |
| 1290 |
const offset = builder.endObject(); |
| 1291 |
builder.requiredField(offset, 10) // name |
| 1292 |
return offset; |
| 1293 |
} |
| 1294 |
|
| 1295 |
static finishMonsterBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) { |
| 1296 |
builder.finish(offset, 'MONS'); |
| 1297 |
} |
| 1298 |
|
| 1299 |
static finishSizePrefixedMonsterBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) { |
| 1300 |
builder.finish(offset, 'MONS', true); |
| 1301 |
} |
| 1302 |
|
| 1303 |
|
| 1304 |
serialize():Uint8Array { |
| 1305 |
return this.bb!.bytes(); |
| 1306 |
} |
| 1307 |
|
| 1308 |
static deserialize(buffer: Uint8Array):Monster { |
| 1309 |
return Monster.getRootAsMonster(new flatbuffers.ByteBuffer(buffer)) |
| 1310 |
} |
| 1311 |
|
| 1312 |
unpack(): MonsterT { |
| 1313 |
return new MonsterT( |
| 1314 |
(this.pos() !== null ? this.pos()!.unpack() : null), |
| 1315 |
this.mana(), |
| 1316 |
this.hp(), |
| 1317 |
this.name(), |
| 1318 |
this.bb!.createScalarList<number>(this.inventory.bind(this), this.inventoryLength()), |
| 1319 |
this.color(), |
| 1320 |
this.testType(), |
| 1321 |
(() => { |
| 1322 |
const temp = unionToAny(this.testType(), this.test.bind(this)); |
| 1323 |
if(temp === null) { return null; } |
| 1324 |
return temp.unpack() |
| 1325 |
})(), |
| 1326 |
this.bb!.createObjList<Test, TestT>(this.test4.bind(this), this.test4Length()), |
| 1327 |
this.bb!.createScalarList<string>(this.testarrayofstring.bind(this), this.testarrayofstringLength()), |
| 1328 |
this.bb!.createObjList<Monster, MonsterT>(this.testarrayoftables.bind(this), this.testarrayoftablesLength()), |
| 1329 |
(this.enemy() !== null ? this.enemy()!.unpack() : null), |
| 1330 |
this.bb!.createScalarList<number>(this.testnestedflatbuffer.bind(this), this.testnestedflatbufferLength()), |
| 1331 |
(this.testempty() !== null ? this.testempty()!.unpack() : null), |
| 1332 |
this.testbool(), |
| 1333 |
this.testhashs32Fnv1(), |
| 1334 |
this.testhashu32Fnv1(), |
| 1335 |
this.testhashs64Fnv1(), |
| 1336 |
this.testhashu64Fnv1(), |
| 1337 |
this.testhashs32Fnv1a(), |
| 1338 |
this.testhashu32Fnv1a(), |
| 1339 |
this.testhashs64Fnv1a(), |
| 1340 |
this.testhashu64Fnv1a(), |
| 1341 |
this.bb!.createScalarList<boolean>(this.testarrayofbools.bind(this), this.testarrayofboolsLength()), |
| 1342 |
this.testf(), |
| 1343 |
this.testf2(), |
| 1344 |
this.testf3(), |
| 1345 |
this.bb!.createScalarList<string>(this.testarrayofstring2.bind(this), this.testarrayofstring2Length()), |
| 1346 |
this.bb!.createObjList<Ability, AbilityT>(this.testarrayofsortedstruct.bind(this), this.testarrayofsortedstructLength()), |
| 1347 |
this.bb!.createScalarList<number>(this.flex.bind(this), this.flexLength()), |
| 1348 |
this.bb!.createObjList<Test, TestT>(this.test5.bind(this), this.test5Length()), |
| 1349 |
this.bb!.createScalarList<bigint>(this.vectorOfLongs.bind(this), this.vectorOfLongsLength()), |
| 1350 |
this.bb!.createScalarList<number>(this.vectorOfDoubles.bind(this), this.vectorOfDoublesLength()), |
| 1351 |
(this.parentNamespaceTest() !== null ? this.parentNamespaceTest()!.unpack() : null), |
| 1352 |
this.bb!.createObjList<Referrable, ReferrableT>(this.vectorOfReferrables.bind(this), this.vectorOfReferrablesLength()), |
| 1353 |
this.singleWeakReference(), |
| 1354 |
this.bb!.createScalarList<bigint>(this.vectorOfWeakReferences.bind(this), this.vectorOfWeakReferencesLength()), |
| 1355 |
this.bb!.createObjList<Referrable, ReferrableT>(this.vectorOfStrongReferrables.bind(this), this.vectorOfStrongReferrablesLength()), |
| 1356 |
this.coOwningReference(), |
| 1357 |
this.bb!.createScalarList<bigint>(this.vectorOfCoOwningReferences.bind(this), this.vectorOfCoOwningReferencesLength()), |
| 1358 |
this.nonOwningReference(), |
| 1359 |
this.bb!.createScalarList<bigint>(this.vectorOfNonOwningReferences.bind(this), this.vectorOfNonOwningReferencesLength()), |
| 1360 |
this.anyUniqueType(), |
| 1361 |
(() => { |
| 1362 |
const temp = unionToAnyUniqueAliases(this.anyUniqueType(), this.anyUnique.bind(this)); |
| 1363 |
if(temp === null) { return null; } |
| 1364 |
return temp.unpack() |
| 1365 |
})(), |
| 1366 |
this.anyAmbiguousType(), |
| 1367 |
(() => { |
| 1368 |
const temp = unionToAnyAmbiguousAliases(this.anyAmbiguousType(), this.anyAmbiguous.bind(this)); |
| 1369 |
if(temp === null) { return null; } |
| 1370 |
return temp.unpack() |
| 1371 |
})(), |
| 1372 |
this.bb!.createScalarList<Color>(this.vectorOfEnums.bind(this), this.vectorOfEnumsLength()), |
| 1373 |
this.signedEnum(), |
| 1374 |
this.bb!.createScalarList<number>(this.testrequirednestedflatbuffer.bind(this), this.testrequirednestedflatbufferLength()), |
| 1375 |
this.bb!.createObjList<Stat, StatT>(this.scalarKeySortedTables.bind(this), this.scalarKeySortedTablesLength()), |
| 1376 |
(this.nativeInline() !== null ? this.nativeInline()!.unpack() : null), |
| 1377 |
this.longEnumNonEnumDefault(), |
| 1378 |
this.longEnumNormalDefault(), |
| 1379 |
this.nanDefault(), |
| 1380 |
this.infDefault(), |
| 1381 |
this.positiveInfDefault(), |
| 1382 |
this.infinityDefault(), |
| 1383 |
this.positiveInfinityDefault(), |
| 1384 |
this.negativeInfDefault(), |
| 1385 |
this.negativeInfinityDefault(), |
| 1386 |
this.doubleInfDefault() |
| 1387 |
); |
| 1388 |
} |
| 1389 |
|
| 1390 |
|
| 1391 |
unpackTo(_o: MonsterT): void { |
| 1392 |
_o.pos = (this.pos() !== null ? this.pos()!.unpack() : null); |
| 1393 |
_o.mana = this.mana(); |
| 1394 |
_o.hp = this.hp(); |
| 1395 |
_o.name = this.name(); |
| 1396 |
_o.inventory = this.bb!.createScalarList<number>(this.inventory.bind(this), this.inventoryLength()); |
| 1397 |
_o.color = this.color(); |
| 1398 |
_o.testType = this.testType(); |
| 1399 |
_o.test = (() => { |
| 1400 |
const temp = unionToAny(this.testType(), this.test.bind(this)); |
| 1401 |
if(temp === null) { return null; } |
| 1402 |
return temp.unpack() |
| 1403 |
})(); |
| 1404 |
_o.test4 = this.bb!.createObjList<Test, TestT>(this.test4.bind(this), this.test4Length()); |
| 1405 |
_o.testarrayofstring = this.bb!.createScalarList<string>(this.testarrayofstring.bind(this), this.testarrayofstringLength()); |
| 1406 |
_o.testarrayoftables = this.bb!.createObjList<Monster, MonsterT>(this.testarrayoftables.bind(this), this.testarrayoftablesLength()); |
| 1407 |
_o.enemy = (this.enemy() !== null ? this.enemy()!.unpack() : null); |
| 1408 |
_o.testnestedflatbuffer = this.bb!.createScalarList<number>(this.testnestedflatbuffer.bind(this), this.testnestedflatbufferLength()); |
| 1409 |
_o.testempty = (this.testempty() !== null ? this.testempty()!.unpack() : null); |
| 1410 |
_o.testbool = this.testbool(); |
| 1411 |
_o.testhashs32Fnv1 = this.testhashs32Fnv1(); |
| 1412 |
_o.testhashu32Fnv1 = this.testhashu32Fnv1(); |
| 1413 |
_o.testhashs64Fnv1 = this.testhashs64Fnv1(); |
| 1414 |
_o.testhashu64Fnv1 = this.testhashu64Fnv1(); |
| 1415 |
_o.testhashs32Fnv1a = this.testhashs32Fnv1a(); |
| 1416 |
_o.testhashu32Fnv1a = this.testhashu32Fnv1a(); |
| 1417 |
_o.testhashs64Fnv1a = this.testhashs64Fnv1a(); |
| 1418 |
_o.testhashu64Fnv1a = this.testhashu64Fnv1a(); |
| 1419 |
_o.testarrayofbools = this.bb!.createScalarList<boolean>(this.testarrayofbools.bind(this), this.testarrayofboolsLength()); |
| 1420 |
_o.testf = this.testf(); |
| 1421 |
_o.testf2 = this.testf2(); |
| 1422 |
_o.testf3 = this.testf3(); |
| 1423 |
_o.testarrayofstring2 = this.bb!.createScalarList<string>(this.testarrayofstring2.bind(this), this.testarrayofstring2Length()); |
| 1424 |
_o.testarrayofsortedstruct = this.bb!.createObjList<Ability, AbilityT>(this.testarrayofsortedstruct.bind(this), this.testarrayofsortedstructLength()); |
| 1425 |
_o.flex = this.bb!.createScalarList<number>(this.flex.bind(this), this.flexLength()); |
| 1426 |
_o.test5 = this.bb!.createObjList<Test, TestT>(this.test5.bind(this), this.test5Length()); |
| 1427 |
_o.vectorOfLongs = this.bb!.createScalarList<bigint>(this.vectorOfLongs.bind(this), this.vectorOfLongsLength()); |
| 1428 |
_o.vectorOfDoubles = this.bb!.createScalarList<number>(this.vectorOfDoubles.bind(this), this.vectorOfDoublesLength()); |
| 1429 |
_o.parentNamespaceTest = (this.parentNamespaceTest() !== null ? this.parentNamespaceTest()!.unpack() : null); |
| 1430 |
_o.vectorOfReferrables = this.bb!.createObjList<Referrable, ReferrableT>(this.vectorOfReferrables.bind(this), this.vectorOfReferrablesLength()); |
| 1431 |
_o.singleWeakReference = this.singleWeakReference(); |
| 1432 |
_o.vectorOfWeakReferences = this.bb!.createScalarList<bigint>(this.vectorOfWeakReferences.bind(this), this.vectorOfWeakReferencesLength()); |
| 1433 |
_o.vectorOfStrongReferrables = this.bb!.createObjList<Referrable, ReferrableT>(this.vectorOfStrongReferrables.bind(this), this.vectorOfStrongReferrablesLength()); |
| 1434 |
_o.coOwningReference = this.coOwningReference(); |
| 1435 |
_o.vectorOfCoOwningReferences = this.bb!.createScalarList<bigint>(this.vectorOfCoOwningReferences.bind(this), this.vectorOfCoOwningReferencesLength()); |
| 1436 |
_o.nonOwningReference = this.nonOwningReference(); |
| 1437 |
_o.vectorOfNonOwningReferences = this.bb!.createScalarList<bigint>(this.vectorOfNonOwningReferences.bind(this), this.vectorOfNonOwningReferencesLength()); |
| 1438 |
_o.anyUniqueType = this.anyUniqueType(); |
| 1439 |
_o.anyUnique = (() => { |
| 1440 |
const temp = unionToAnyUniqueAliases(this.anyUniqueType(), this.anyUnique.bind(this)); |
| 1441 |
if(temp === null) { return null; } |
| 1442 |
return temp.unpack() |
| 1443 |
})(); |
| 1444 |
_o.anyAmbiguousType = this.anyAmbiguousType(); |
| 1445 |
_o.anyAmbiguous = (() => { |
| 1446 |
const temp = unionToAnyAmbiguousAliases(this.anyAmbiguousType(), this.anyAmbiguous.bind(this)); |
| 1447 |
if(temp === null) { return null; } |
| 1448 |
return temp.unpack() |
| 1449 |
})(); |
| 1450 |
_o.vectorOfEnums = this.bb!.createScalarList<Color>(this.vectorOfEnums.bind(this), this.vectorOfEnumsLength()); |
| 1451 |
_o.signedEnum = this.signedEnum(); |
| 1452 |
_o.testrequirednestedflatbuffer = this.bb!.createScalarList<number>(this.testrequirednestedflatbuffer.bind(this), this.testrequirednestedflatbufferLength()); |
| 1453 |
_o.scalarKeySortedTables = this.bb!.createObjList<Stat, StatT>(this.scalarKeySortedTables.bind(this), this.scalarKeySortedTablesLength()); |
| 1454 |
_o.nativeInline = (this.nativeInline() !== null ? this.nativeInline()!.unpack() : null); |
| 1455 |
_o.longEnumNonEnumDefault = this.longEnumNonEnumDefault(); |
| 1456 |
_o.longEnumNormalDefault = this.longEnumNormalDefault(); |
| 1457 |
_o.nanDefault = this.nanDefault(); |
| 1458 |
_o.infDefault = this.infDefault(); |
| 1459 |
_o.positiveInfDefault = this.positiveInfDefault(); |
| 1460 |
_o.infinityDefault = this.infinityDefault(); |
| 1461 |
_o.positiveInfinityDefault = this.positiveInfinityDefault(); |
| 1462 |
_o.negativeInfDefault = this.negativeInfDefault(); |
| 1463 |
_o.negativeInfinityDefault = this.negativeInfinityDefault(); |
| 1464 |
_o.doubleInfDefault = this.doubleInfDefault(); |
| 1465 |
} |
| 1466 |
} |
| 1467 |
|
| 1468 |
export class MonsterT implements flatbuffers.IGeneratedObject { |
| 1469 |
constructor( |
| 1470 |
public pos: Vec3T|null = null, |
| 1471 |
public mana: number = 150, |
| 1472 |
public hp: number = 100, |
| 1473 |
public name: string|Uint8Array|null = null, |
| 1474 |
public inventory: (number)[] = [], |
| 1475 |
public color: Color = Color.Blue, |
| 1476 |
public testType: Any = Any.NONE, |
| 1477 |
public test: MonsterT|MyGame_Example2_MonsterT|TestSimpleTableWithEnumT|null = null, |
| 1478 |
public test4: (TestT)[] = [], |
| 1479 |
public testarrayofstring: (string)[] = [], |
| 1480 |
public testarrayoftables: (MonsterT)[] = [], |
| 1481 |
public enemy: MonsterT|null = null, |
| 1482 |
public testnestedflatbuffer: (number)[] = [], |
| 1483 |
public testempty: StatT|null = null, |
| 1484 |
public testbool: boolean = false, |
| 1485 |
public testhashs32Fnv1: number = 0, |
| 1486 |
public testhashu32Fnv1: number = 0, |
| 1487 |
public testhashs64Fnv1: bigint = BigInt('0'), |
| 1488 |
public testhashu64Fnv1: bigint = BigInt('0'), |
| 1489 |
public testhashs32Fnv1a: number = 0, |
| 1490 |
public testhashu32Fnv1a: number = 0, |
| 1491 |
public testhashs64Fnv1a: bigint = BigInt('0'), |
| 1492 |
public testhashu64Fnv1a: bigint = BigInt('0'), |
| 1493 |
public testarrayofbools: (boolean)[] = [], |
| 1494 |
public testf: number = 3.14159, |
| 1495 |
public testf2: number = 3.0, |
| 1496 |
public testf3: number = 0.0, |
| 1497 |
public testarrayofstring2: (string)[] = [], |
| 1498 |
public testarrayofsortedstruct: (AbilityT)[] = [], |
| 1499 |
public flex: (number)[] = [], |
| 1500 |
public test5: (TestT)[] = [], |
| 1501 |
public vectorOfLongs: (bigint)[] = [], |
| 1502 |
public vectorOfDoubles: (number)[] = [], |
| 1503 |
public parentNamespaceTest: InParentNamespaceT|null = null, |
| 1504 |
public vectorOfReferrables: (ReferrableT)[] = [], |
| 1505 |
public singleWeakReference: bigint = BigInt('0'), |
| 1506 |
public vectorOfWeakReferences: (bigint)[] = [], |
| 1507 |
public vectorOfStrongReferrables: (ReferrableT)[] = [], |
| 1508 |
public coOwningReference: bigint = BigInt('0'), |
| 1509 |
public vectorOfCoOwningReferences: (bigint)[] = [], |
| 1510 |
public nonOwningReference: bigint = BigInt('0'), |
| 1511 |
public vectorOfNonOwningReferences: (bigint)[] = [], |
| 1512 |
public anyUniqueType: AnyUniqueAliases = AnyUniqueAliases.NONE, |
| 1513 |
public anyUnique: MonsterT|MyGame_Example2_MonsterT|TestSimpleTableWithEnumT|null = null, |
| 1514 |
public anyAmbiguousType: AnyAmbiguousAliases = AnyAmbiguousAliases.NONE, |
| 1515 |
public anyAmbiguous: MonsterT|null = null, |
| 1516 |
public vectorOfEnums: (Color)[] = [], |
| 1517 |
public signedEnum: Race = Race.None, |
| 1518 |
public testrequirednestedflatbuffer: (number)[] = [], |
| 1519 |
public scalarKeySortedTables: (StatT)[] = [], |
| 1520 |
public nativeInline: TestT|null = null, |
| 1521 |
public longEnumNonEnumDefault: bigint = BigInt('0'), |
| 1522 |
public longEnumNormalDefault: bigint = BigInt('2'), |
| 1523 |
public nanDefault: number = NaN, |
| 1524 |
public infDefault: number = Infinity, |
| 1525 |
public positiveInfDefault: number = Infinity, |
| 1526 |
public infinityDefault: number = Infinity, |
| 1527 |
public positiveInfinityDefault: number = Infinity, |
| 1528 |
public negativeInfDefault: number = -Infinity, |
| 1529 |
public negativeInfinityDefault: number = -Infinity, |
| 1530 |
public doubleInfDefault: number = Infinity |
| 1531 |
){} |
| 1532 |
|
| 1533 |
|
| 1534 |
pack(builder:flatbuffers.Builder): flatbuffers.Offset { |
| 1535 |
const name = (this.name !== null ? builder.createString(this.name!) : 0); |
| 1536 |
const inventory = Monster.createInventoryVector(builder, this.inventory); |
| 1537 |
const test = builder.createObjectOffset(this.test); |
| 1538 |
const test4 = builder.createStructOffsetList(this.test4, Monster.startTest4Vector); |
| 1539 |
const testarrayofstring = Monster.createTestarrayofstringVector(builder, builder.createObjectOffsetList(this.testarrayofstring)); |
| 1540 |
const testarrayoftables = Monster.createTestarrayoftablesVector(builder, builder.createObjectOffsetList(this.testarrayoftables)); |
| 1541 |
const enemy = (this.enemy !== null ? this.enemy!.pack(builder) : 0); |
| 1542 |
const testnestedflatbuffer = Monster.createTestnestedflatbufferVector(builder, this.testnestedflatbuffer); |
| 1543 |
const testempty = (this.testempty !== null ? this.testempty!.pack(builder) : 0); |
| 1544 |
const testarrayofbools = Monster.createTestarrayofboolsVector(builder, this.testarrayofbools); |
| 1545 |
const testarrayofstring2 = Monster.createTestarrayofstring2Vector(builder, builder.createObjectOffsetList(this.testarrayofstring2)); |
| 1546 |
const testarrayofsortedstruct = builder.createStructOffsetList(this.testarrayofsortedstruct, Monster.startTestarrayofsortedstructVector); |
| 1547 |
const flex = Monster.createFlexVector(builder, this.flex); |
| 1548 |
const test5 = builder.createStructOffsetList(this.test5, Monster.startTest5Vector); |
| 1549 |
const vectorOfLongs = Monster.createVectorOfLongsVector(builder, this.vectorOfLongs); |
| 1550 |
const vectorOfDoubles = Monster.createVectorOfDoublesVector(builder, this.vectorOfDoubles); |
| 1551 |
const parentNamespaceTest = (this.parentNamespaceTest !== null ? this.parentNamespaceTest!.pack(builder) : 0); |
| 1552 |
const vectorOfReferrables = Monster.createVectorOfReferrablesVector(builder, builder.createObjectOffsetList(this.vectorOfReferrables)); |
| 1553 |
const vectorOfWeakReferences = Monster.createVectorOfWeakReferencesVector(builder, this.vectorOfWeakReferences); |
| 1554 |
const vectorOfStrongReferrables = Monster.createVectorOfStrongReferrablesVector(builder, builder.createObjectOffsetList(this.vectorOfStrongReferrables)); |
| 1555 |
const vectorOfCoOwningReferences = Monster.createVectorOfCoOwningReferencesVector(builder, this.vectorOfCoOwningReferences); |
| 1556 |
const vectorOfNonOwningReferences = Monster.createVectorOfNonOwningReferencesVector(builder, this.vectorOfNonOwningReferences); |
| 1557 |
const anyUnique = builder.createObjectOffset(this.anyUnique); |
| 1558 |
const anyAmbiguous = builder.createObjectOffset(this.anyAmbiguous); |
| 1559 |
const vectorOfEnums = Monster.createVectorOfEnumsVector(builder, this.vectorOfEnums); |
| 1560 |
const testrequirednestedflatbuffer = Monster.createTestrequirednestedflatbufferVector(builder, this.testrequirednestedflatbuffer); |
| 1561 |
const scalarKeySortedTables = Monster.createScalarKeySortedTablesVector(builder, builder.createObjectOffsetList(this.scalarKeySortedTables)); |
| 1562 |
|
| 1563 |
Monster.startMonster(builder); |
| 1564 |
Monster.addPos(builder, (this.pos !== null ? this.pos!.pack(builder) : 0)); |
| 1565 |
Monster.addMana(builder, this.mana); |
| 1566 |
Monster.addHp(builder, this.hp); |
| 1567 |
Monster.addName(builder, name); |
| 1568 |
Monster.addInventory(builder, inventory); |
| 1569 |
Monster.addColor(builder, this.color); |
| 1570 |
Monster.addTestType(builder, this.testType); |
| 1571 |
Monster.addTest(builder, test); |
| 1572 |
Monster.addTest4(builder, test4); |
| 1573 |
Monster.addTestarrayofstring(builder, testarrayofstring); |
| 1574 |
Monster.addTestarrayoftables(builder, testarrayoftables); |
| 1575 |
Monster.addEnemy(builder, enemy); |
| 1576 |
Monster.addTestnestedflatbuffer(builder, testnestedflatbuffer); |
| 1577 |
Monster.addTestempty(builder, testempty); |
| 1578 |
Monster.addTestbool(builder, this.testbool); |
| 1579 |
Monster.addTesthashs32Fnv1(builder, this.testhashs32Fnv1); |
| 1580 |
Monster.addTesthashu32Fnv1(builder, this.testhashu32Fnv1); |
| 1581 |
Monster.addTesthashs64Fnv1(builder, this.testhashs64Fnv1); |
| 1582 |
Monster.addTesthashu64Fnv1(builder, this.testhashu64Fnv1); |
| 1583 |
Monster.addTesthashs32Fnv1a(builder, this.testhashs32Fnv1a); |
| 1584 |
Monster.addTesthashu32Fnv1a(builder, this.testhashu32Fnv1a); |
| 1585 |
Monster.addTesthashs64Fnv1a(builder, this.testhashs64Fnv1a); |
| 1586 |
Monster.addTesthashu64Fnv1a(builder, this.testhashu64Fnv1a); |
| 1587 |
Monster.addTestarrayofbools(builder, testarrayofbools); |
| 1588 |
Monster.addTestf(builder, this.testf); |
| 1589 |
Monster.addTestf2(builder, this.testf2); |
| 1590 |
Monster.addTestf3(builder, this.testf3); |
| 1591 |
Monster.addTestarrayofstring2(builder, testarrayofstring2); |
| 1592 |
Monster.addTestarrayofsortedstruct(builder, testarrayofsortedstruct); |
| 1593 |
Monster.addFlex(builder, flex); |
| 1594 |
Monster.addTest5(builder, test5); |
| 1595 |
Monster.addVectorOfLongs(builder, vectorOfLongs); |
| 1596 |
Monster.addVectorOfDoubles(builder, vectorOfDoubles); |
| 1597 |
Monster.addParentNamespaceTest(builder, parentNamespaceTest); |
| 1598 |
Monster.addVectorOfReferrables(builder, vectorOfReferrables); |
| 1599 |
Monster.addSingleWeakReference(builder, this.singleWeakReference); |
| 1600 |
Monster.addVectorOfWeakReferences(builder, vectorOfWeakReferences); |
| 1601 |
Monster.addVectorOfStrongReferrables(builder, vectorOfStrongReferrables); |
| 1602 |
Monster.addCoOwningReference(builder, this.coOwningReference); |
| 1603 |
Monster.addVectorOfCoOwningReferences(builder, vectorOfCoOwningReferences); |
| 1604 |
Monster.addNonOwningReference(builder, this.nonOwningReference); |
| 1605 |
Monster.addVectorOfNonOwningReferences(builder, vectorOfNonOwningReferences); |
| 1606 |
Monster.addAnyUniqueType(builder, this.anyUniqueType); |
| 1607 |
Monster.addAnyUnique(builder, anyUnique); |
| 1608 |
Monster.addAnyAmbiguousType(builder, this.anyAmbiguousType); |
| 1609 |
Monster.addAnyAmbiguous(builder, anyAmbiguous); |
| 1610 |
Monster.addVectorOfEnums(builder, vectorOfEnums); |
| 1611 |
Monster.addSignedEnum(builder, this.signedEnum); |
| 1612 |
Monster.addTestrequirednestedflatbuffer(builder, testrequirednestedflatbuffer); |
| 1613 |
Monster.addScalarKeySortedTables(builder, scalarKeySortedTables); |
| 1614 |
Monster.addNativeInline(builder, (this.nativeInline !== null ? this.nativeInline!.pack(builder) : 0)); |
| 1615 |
Monster.addLongEnumNonEnumDefault(builder, this.longEnumNonEnumDefault); |
| 1616 |
Monster.addLongEnumNormalDefault(builder, this.longEnumNormalDefault); |
| 1617 |
Monster.addNanDefault(builder, this.nanDefault); |
| 1618 |
Monster.addInfDefault(builder, this.infDefault); |
| 1619 |
Monster.addPositiveInfDefault(builder, this.positiveInfDefault); |
| 1620 |
Monster.addInfinityDefault(builder, this.infinityDefault); |
| 1621 |
Monster.addPositiveInfinityDefault(builder, this.positiveInfinityDefault); |
| 1622 |
Monster.addNegativeInfDefault(builder, this.negativeInfDefault); |
| 1623 |
Monster.addNegativeInfinityDefault(builder, this.negativeInfinityDefault); |
| 1624 |
Monster.addDoubleInfDefault(builder, this.doubleInfDefault); |
| 1625 |
|
| 1626 |
return Monster.endMonster(builder); |
| 1627 |
} |
| 1628 |
} |