# automatically generated by the FlatBuffers compiler, do not modify

# namespace: flat

import flatbuffers

# /// A minimal version of player data, useful when bandwidth needs to be conserved.
class TinyPlayer(object):
    __slots__ = ['_tab']

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

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

    # TinyPlayer
    def Location(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            x = o + self._tab.Pos
            from .Vector3 import Vector3
            obj = Vector3()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # TinyPlayer
    def Rotation(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            x = o + self._tab.Pos
            from .Rotator import Rotator
            obj = Rotator()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # TinyPlayer
    def Velocity(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            x = o + self._tab.Pos
            from .Vector3 import Vector3
            obj = Vector3()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # TinyPlayer
    def HasWheelContact(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)
        return 0

    # TinyPlayer
    def IsSupersonic(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)
        return 0

    # TinyPlayer
    def Team(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
        return 0

    # TinyPlayer
    def Boost(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
        return 0

def TinyPlayerStart(builder): builder.StartObject(7)
def TinyPlayerAddLocation(builder, location): builder.PrependStructSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(location), 0)
def TinyPlayerAddRotation(builder, rotation): builder.PrependStructSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(rotation), 0)
def TinyPlayerAddVelocity(builder, velocity): builder.PrependStructSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(velocity), 0)
def TinyPlayerAddHasWheelContact(builder, hasWheelContact): builder.PrependBoolSlot(3, hasWheelContact, 0)
def TinyPlayerAddIsSupersonic(builder, isSupersonic): builder.PrependBoolSlot(4, isSupersonic, 0)
def TinyPlayerAddTeam(builder, team): builder.PrependInt32Slot(5, team, 0)
def TinyPlayerAddBoost(builder, boost): builder.PrependInt32Slot(6, boost, 0)
def TinyPlayerEnd(builder): return builder.EndObject()
