• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// automatically generated by the FlatBuffers compiler, do not modify
2
3import * as flatbuffers from 'flatbuffers';
4
5
6
7export class Referrable {
8  bb: flatbuffers.ByteBuffer|null = null;
9  bb_pos = 0;
10__init(i:number, bb:flatbuffers.ByteBuffer):Referrable {
11  this.bb_pos = i;
12  this.bb = bb;
13  return this;
14}
15
16static getRootAsReferrable(bb:flatbuffers.ByteBuffer, obj?:Referrable):Referrable {
17  return (obj || new Referrable()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
18}
19
20static getSizePrefixedRootAsReferrable(bb:flatbuffers.ByteBuffer, obj?:Referrable):Referrable {
21  bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
22  return (obj || new Referrable()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
23}
24
25id():flatbuffers.Long {
26  const offset = this.bb!.__offset(this.bb_pos, 4);
27  return offset ? this.bb!.readUint64(this.bb_pos + offset) : this.bb!.createLong(0, 0);
28}
29
30mutate_id(value:flatbuffers.Long):boolean {
31  const offset = this.bb!.__offset(this.bb_pos, 4);
32
33  if (offset === 0) {
34    return false;
35  }
36
37  this.bb!.writeUint64(this.bb_pos + offset, value);
38  return true;
39}
40
41static getFullyQualifiedName():string {
42  return 'MyGame.Example.Referrable';
43}
44
45static startReferrable(builder:flatbuffers.Builder) {
46  builder.startObject(1);
47}
48
49static addId(builder:flatbuffers.Builder, id:flatbuffers.Long) {
50  builder.addFieldInt64(0, id, builder.createLong(0, 0));
51}
52
53static endReferrable(builder:flatbuffers.Builder):flatbuffers.Offset {
54  const offset = builder.endObject();
55  return offset;
56}
57
58static createReferrable(builder:flatbuffers.Builder, id:flatbuffers.Long):flatbuffers.Offset {
59  Referrable.startReferrable(builder);
60  Referrable.addId(builder, id);
61  return Referrable.endReferrable(builder);
62}
63
64serialize():Uint8Array {
65  return this.bb!.bytes();
66}
67
68static deserialize(buffer: Uint8Array):Referrable {
69  return Referrable.getRootAsReferrable(new flatbuffers.ByteBuffer(buffer))
70}
71
72unpack(): ReferrableT {
73  return new ReferrableT(
74    this.id()
75  );
76}
77
78
79unpackTo(_o: ReferrableT): void {
80  _o.id = this.id();
81}
82}
83
84export class ReferrableT {
85constructor(
86  public id: flatbuffers.Long = flatbuffers.createLong(0, 0)
87){}
88
89
90pack(builder:flatbuffers.Builder): flatbuffers.Offset {
91  return Referrable.createReferrable(builder,
92    this.id
93  );
94}
95}
96