James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 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 StructOfStructs : Struct() { |
| 11 | |
| 12 | fun __init(_i: Int, _bb: ByteBuffer) { |
| 13 | __reset(_i, _bb) |
| 14 | } |
| 15 | fun __assign(_i: Int, _bb: ByteBuffer) : StructOfStructs { |
| 16 | __init(_i, _bb) |
| 17 | return this |
| 18 | } |
| 19 | val a : MyGame.Example.Ability? get() = a(MyGame.Example.Ability()) |
| 20 | fun a(obj: MyGame.Example.Ability) : MyGame.Example.Ability? = obj.__assign(bb_pos + 0, bb) |
| 21 | val b : MyGame.Example.Test? get() = b(MyGame.Example.Test()) |
| 22 | fun b(obj: MyGame.Example.Test) : MyGame.Example.Test? = obj.__assign(bb_pos + 8, bb) |
| 23 | val c : MyGame.Example.Ability? get() = c(MyGame.Example.Ability()) |
| 24 | fun c(obj: MyGame.Example.Ability) : MyGame.Example.Ability? = obj.__assign(bb_pos + 12, bb) |
| 25 | companion object { |
| 26 | fun createStructOfStructs(builder: FlatBufferBuilder, a_id: UInt, a_distance: UInt, b_a: Short, b_b: Byte, c_id: UInt, c_distance: UInt) : Int { |
| 27 | builder.prep(4, 20) |
| 28 | builder.prep(4, 8) |
| 29 | builder.putInt(c_distance.toInt()) |
| 30 | builder.putInt(c_id.toInt()) |
| 31 | builder.prep(2, 4) |
| 32 | builder.pad(1) |
| 33 | builder.putByte(b_b) |
| 34 | builder.putShort(b_a) |
| 35 | builder.prep(4, 8) |
| 36 | builder.putInt(a_distance.toInt()) |
| 37 | builder.putInt(a_id.toInt()) |
| 38 | return builder.offset() |
| 39 | } |
| 40 | } |
| 41 | } |