<gh_stars>10-100
# automatically generated by the FlatBuffers compiler, do not modify

# namespace: KartKraft

import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()

# Data associated with a vehicle which doesn't change dynamically during a race. e.g. class, num gears, driver name etc
class VehicleConfig(object):
    __slots__ = ['_tab']

    @classmethod
    def GetRootAsVehicleConfig(cls, buf, offset):
        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
        x = VehicleConfig()
        x.Init(buf, n + offset)
        return x

    @classmethod
    def VehicleConfigBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
        return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x4B\x4B\x46\x42", size_prefixed=size_prefixed)

    # VehicleConfig
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

    # VehicleConfig
    def RpmLimit(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos)
        return 0.0

    # VehicleConfig
    def RpmMax(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos)
        return 0.0

    # VehicleConfig
    def GearMax(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
        return 0

def VehicleConfigStart(builder): builder.StartObject(3)
def VehicleConfigAddRpmLimit(builder, rpmLimit): builder.PrependFloat32Slot(0, rpmLimit, 0.0)
def VehicleConfigAddRpmMax(builder, rpmMax): builder.PrependFloat32Slot(1, rpmMax, 0.0)
def VehicleConfigAddGearMax(builder, gearMax): builder.PrependInt8Slot(2, gearMax, 0)
def VehicleConfigEnd(builder): return builder.EndObject()
