xref: /aosp_15_r20/external/flatbuffers/tests/MyGame/Example/Vec3.kt (revision 890232f25432b36107d06881e0a25aaa6b473652)
1 // automatically generated by the FlatBuffers compiler, do not modify
2 
3 package MyGame.Example
4 
5 import java.nio.*
6 import kotlin.math.sign
7 import com.google.flatbuffers.*
8 
9 @Suppress("unused")
10 class Vec3 : Struct() {
11 
__initnull12     fun __init(_i: Int, _bb: ByteBuffer)  {
13         __reset(_i, _bb)
14     }
__assignnull15     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)
mutateXnull20     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 }
50