...
1// automatically generated by the FlatBuffers compiler, do not modify
2
3import com.google.flatbuffers.BaseVector
4import com.google.flatbuffers.BooleanVector
5import com.google.flatbuffers.ByteVector
6import com.google.flatbuffers.Constants
7import com.google.flatbuffers.DoubleVector
8import com.google.flatbuffers.FlatBufferBuilder
9import com.google.flatbuffers.FloatVector
10import com.google.flatbuffers.LongVector
11import com.google.flatbuffers.StringVector
12import com.google.flatbuffers.Struct
13import com.google.flatbuffers.Table
14import com.google.flatbuffers.UnionVector
15import java.nio.ByteBuffer
16import java.nio.ByteOrder
17import kotlin.math.sign
18
19@Suppress("unused")
20class Galaxy : Table() {
21
22 fun __init(_i: Int, _bb: ByteBuffer) {
23 __reset(_i, _bb)
24 }
25 fun __assign(_i: Int, _bb: ByteBuffer) : Galaxy {
26 __init(_i, _bb)
27 return this
28 }
29 val numStars : Long
30 get() {
31 val o = __offset(4)
32 return if(o != 0) bb.getLong(o + bb_pos) else 0L
33 }
34 companion object {
35 fun validateVersion() = Constants.FLATBUFFERS_23_5_26()
36 fun getRootAsGalaxy(_bb: ByteBuffer): Galaxy = getRootAsGalaxy(_bb, Galaxy())
37 fun getRootAsGalaxy(_bb: ByteBuffer, obj: Galaxy): Galaxy {
38 _bb.order(ByteOrder.LITTLE_ENDIAN)
39 return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb))
40 }
41 fun createGalaxy(builder: FlatBufferBuilder, numStars: Long) : Int {
42 builder.startTable(1)
43 addNumStars(builder, numStars)
44 return endGalaxy(builder)
45 }
46 fun startGalaxy(builder: FlatBufferBuilder) = builder.startTable(1)
47 fun addNumStars(builder: FlatBufferBuilder, numStars: Long) = builder.addLong(0, numStars, 0L)
48 fun endGalaxy(builder: FlatBufferBuilder) : Int {
49 val o = builder.endTable()
50 return o
51 }
52 }
53}
View as plain text