| 1 |
// automatically generated by the FlatBuffers compiler, do not modify |
| 2 |
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ |
| 3 |
import * as flatbuffers from 'flatbuffers'; |
| 4 |
export class Referrable { |
| 5 |
constructor() { |
| 6 |
this.bb = null; |
| 7 |
this.bb_pos = 0; |
| 8 |
} |
| 9 |
__init(i, bb) { |
| 10 |
this.bb_pos = i; |
| 11 |
this.bb = bb; |
| 12 |
return this; |
| 13 |
} |
| 14 |
static getRootAsReferrable(bb, obj) { |
| 15 |
return (obj || new Referrable()).__init(bb.readInt32(bb.position()) + bb.position(), bb); |
| 16 |
} |
| 17 |
static getSizePrefixedRootAsReferrable(bb, obj) { |
| 18 |
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); |
| 19 |
return (obj || new Referrable()).__init(bb.readInt32(bb.position()) + bb.position(), bb); |
| 20 |
} |
| 21 |
id() { |
| 22 |
const offset = this.bb.__offset(this.bb_pos, 4); |
| 23 |
return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0'); |
| 24 |
} |
| 25 |
mutate_id(value) { |
| 26 |
const offset = this.bb.__offset(this.bb_pos, 4); |
| 27 |
if (offset === 0) { |
| 28 |
return false; |
| 29 |
} |
| 30 |
this.bb.writeUint64(this.bb_pos + offset, value); |
| 31 |
return true; |
| 32 |
} |
| 33 |
static getFullyQualifiedName() { |
| 34 |
return 'MyGame.Example.Referrable'; |
| 35 |
} |
| 36 |
static startReferrable(builder) { |
| 37 |
builder.startObject(1); |
| 38 |
} |
| 39 |
static addId(builder, id) { |
| 40 |
builder.addFieldInt64(0, id, BigInt('0')); |
| 41 |
} |
| 42 |
static endReferrable(builder) { |
| 43 |
const offset = builder.endObject(); |
| 44 |
return offset; |
| 45 |
} |
| 46 |
static createReferrable(builder, id) { |
| 47 |
Referrable.startReferrable(builder); |
| 48 |
Referrable.addId(builder, id); |
| 49 |
return Referrable.endReferrable(builder); |
| 50 |
} |
| 51 |
serialize() { |
| 52 |
return this.bb.bytes(); |
| 53 |
} |
| 54 |
static deserialize(buffer) { |
| 55 |
return Referrable.getRootAsReferrable(new flatbuffers.ByteBuffer(buffer)); |
| 56 |
} |
| 57 |
unpack() { |
| 58 |
return new ReferrableT(this.id()); |
| 59 |
} |
| 60 |
unpackTo(_o) { |
| 61 |
_o.id = this.id(); |
| 62 |
} |
| 63 |
} |
| 64 |
export class ReferrableT { |
| 65 |
constructor(id = BigInt('0')) { |
| 66 |
this.id = id; |
| 67 |
} |
| 68 |
pack(builder) { |
| 69 |
return Referrable.createReferrable(builder, this.id); |
| 70 |
} |
| 71 |
} |