...
1// automatically generated by the FlatBuffers compiler, do not modify
2
3import * as flatbuffers from 'flatbuffers';
4
5export class Galaxy {
6 bb: flatbuffers.ByteBuffer|null = null;
7 bb_pos = 0;
8 __init(i:number, bb:flatbuffers.ByteBuffer):Galaxy {
9 this.bb_pos = i;
10 this.bb = bb;
11 return this;
12}
13
14static getRootAsGalaxy(bb:flatbuffers.ByteBuffer, obj?:Galaxy):Galaxy {
15 return (obj || new Galaxy()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
16}
17
18static getSizePrefixedRootAsGalaxy(bb:flatbuffers.ByteBuffer, obj?:Galaxy):Galaxy {
19 bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
20 return (obj || new Galaxy()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
21}
22
23numStars():bigint {
24 const offset = this.bb!.__offset(this.bb_pos, 4);
25 return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0');
26}
27
28static startGalaxy(builder:flatbuffers.Builder) {
29 builder.startObject(1);
30}
31
32static addNumStars(builder:flatbuffers.Builder, numStars:bigint) {
33 builder.addFieldInt64(0, numStars, BigInt('0'));
34}
35
36static endGalaxy(builder:flatbuffers.Builder):flatbuffers.Offset {
37 const offset = builder.endObject();
38 return offset;
39}
40
41static createGalaxy(builder:flatbuffers.Builder, numStars:bigint):flatbuffers.Offset {
42 Galaxy.startGalaxy(builder);
43 Galaxy.addNumStars(builder, numStars);
44 return Galaxy.endGalaxy(builder);
45}
46}
View as plain text