blob: 445601c703948b39ad9c7575915f4ef9c912a5df [file] [log] [blame]
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001// automatically generated by the FlatBuffers compiler, do not modify
2
3package MyGame.Example
4
5import java.nio.*
6import kotlin.math.sign
7import com.google.flatbuffers.*
8
9@Suppress("unused")
Austin Schuhe89fa2d2019-08-14 20:24:23 -070010class Vec3 : Struct() {
11
12 fun __init(_i: Int, _bb: ByteBuffer) {
13 __reset(_i, _bb)
14 }
15 fun __assign(_i: Int, _bb: ByteBuffer) : Vec3 {
16 __init(_i, _bb)
17 return this
18 }
19 val x : Float get() = bb.getFloat(bb_pos + 0)
20 fun mutateX(x: Float) : ByteBuffer = bb.putFloat(bb_pos + 0, x)
21 val y : Float get() = bb.getFloat(bb_pos + 4)
22 fun mutateY(y: Float) : ByteBuffer = bb.putFloat(bb_pos + 4, y)
23 val z : Float get() = bb.getFloat(bb_pos + 8)
24 fun mutateZ(z: Float) : ByteBuffer = bb.putFloat(bb_pos + 8, z)
25 val test1 : Double get() = bb.getDouble(bb_pos + 16)
26 fun mutateTest1(test1: Double) : ByteBuffer = bb.putDouble(bb_pos + 16, test1)
27 val test2 : UByte get() = bb.get(bb_pos + 24).toUByte()
28 fun mutateTest2(test2: UByte) : ByteBuffer = bb.put(bb_pos + 24, test2.toByte())
29 val test3 : MyGame.Example.Test? get() = test3(MyGame.Example.Test())
30 fun test3(obj: MyGame.Example.Test) : MyGame.Example.Test? = obj.__assign(bb_pos + 26, bb)
31 companion object {
32 fun createVec3(builder: FlatBufferBuilder, x: Float, y: Float, z: Float, test1: Double, test2: UByte, test3_a: Short, test3_b: Byte) : Int {
33 builder.prep(8, 32)
34 builder.pad(2)
35 builder.prep(2, 4)
36 builder.pad(1)
37 builder.putByte(test3_b)
38 builder.putShort(test3_a)
39 builder.pad(1)
40 builder.putByte(test2.toByte())
41 builder.putDouble(test1)
42 builder.pad(4)
43 builder.putFloat(z)
44 builder.putFloat(y)
45 builder.putFloat(x)
46 return builder.offset()
47 }
48 }
49}