"Fossies" - the Fresh Open Source Software Archive

Member "flatbuffers-23.1.21/tests/MyGame/Example/Ability.kt" (21 Jan 2023, 1503 Bytes) of package /linux/misc/flatbuffers-23.1.21.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Kotlin source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "Ability.kt": 23.1.4_vs_23.1.20.

    1 // automatically generated by the FlatBuffers compiler, do not modify
    2 
    3 package MyGame.Example
    4 
    5 import com.google.flatbuffers.BaseVector
    6 import com.google.flatbuffers.BooleanVector
    7 import com.google.flatbuffers.ByteVector
    8 import com.google.flatbuffers.Constants
    9 import com.google.flatbuffers.DoubleVector
   10 import com.google.flatbuffers.FlatBufferBuilder
   11 import com.google.flatbuffers.FloatVector
   12 import com.google.flatbuffers.LongVector
   13 import com.google.flatbuffers.StringVector
   14 import com.google.flatbuffers.Struct
   15 import com.google.flatbuffers.Table
   16 import com.google.flatbuffers.UnionVector
   17 import java.nio.ByteBuffer
   18 import java.nio.ByteOrder
   19 import kotlin.math.sign
   20 
   21 @Suppress("unused")
   22 @kotlin.ExperimentalUnsignedTypes
   23 class Ability : Struct() {
   24 
   25     fun __init(_i: Int, _bb: ByteBuffer)  {
   26         __reset(_i, _bb)
   27     }
   28     fun __assign(_i: Int, _bb: ByteBuffer) : Ability {
   29         __init(_i, _bb)
   30         return this
   31     }
   32     val id : UInt get() = bb.getInt(bb_pos + 0).toUInt()
   33     fun mutateId(id: UInt) : ByteBuffer = bb.putInt(bb_pos + 0, id.toInt())
   34     val distance : UInt get() = bb.getInt(bb_pos + 4).toUInt()
   35     fun mutateDistance(distance: UInt) : ByteBuffer = bb.putInt(bb_pos + 4, distance.toInt())
   36     companion object {
   37         fun createAbility(builder: FlatBufferBuilder, id: UInt, distance: UInt) : Int {
   38             builder.prep(4, 8)
   39             builder.putInt(distance.toInt())
   40             builder.putInt(id.toInt())
   41             return builder.offset()
   42         }
   43     }
   44 }