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