mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-06 02:46:55 +00:00
add rest of golden language directories
This commit is contained in:
46
goldens/ts/galaxy.ts
Normal file
46
goldens/ts/galaxy.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
export class Galaxy {
|
||||
bb: flatbuffers.ByteBuffer|null = null;
|
||||
bb_pos = 0;
|
||||
__init(i:number, bb:flatbuffers.ByteBuffer):Galaxy {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
|
||||
static getRootAsGalaxy(bb:flatbuffers.ByteBuffer, obj?:Galaxy):Galaxy {
|
||||
return (obj || new Galaxy()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
static getSizePrefixedRootAsGalaxy(bb:flatbuffers.ByteBuffer, obj?:Galaxy):Galaxy {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Galaxy()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
numStars():bigint {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0');
|
||||
}
|
||||
|
||||
static startGalaxy(builder:flatbuffers.Builder) {
|
||||
builder.startObject(1);
|
||||
}
|
||||
|
||||
static addNumStars(builder:flatbuffers.Builder, numStars:bigint) {
|
||||
builder.addFieldInt64(0, numStars, BigInt('0'));
|
||||
}
|
||||
|
||||
static endGalaxy(builder:flatbuffers.Builder):flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
return offset;
|
||||
}
|
||||
|
||||
static createGalaxy(builder:flatbuffers.Builder, numStars:bigint):flatbuffers.Offset {
|
||||
Galaxy.startGalaxy(builder);
|
||||
Galaxy.addNumStars(builder, numStars);
|
||||
return Galaxy.endGalaxy(builder);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user