# automatically generated by the FlatBuffers compiler, do not modify

# namespace: flat

import flatbuffers

class GameTickPacket(object):
    __slots__ = ['_tab']

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

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

    # GameTickPacket
    def Players(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            x = self._tab.Vector(o)
            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
            x = self._tab.Indirect(x)
            from .PlayerInfo import PlayerInfo
            obj = PlayerInfo()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # GameTickPacket
    def PlayersLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # GameTickPacket
    def BoostPadStates(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            x = self._tab.Vector(o)
            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
            x = self._tab.Indirect(x)
            from .BoostPadState import BoostPadState
            obj = BoostPadState()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # GameTickPacket
    def BoostPadStatesLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

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

    # GameTickPacket
    def GameInfo(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            from .GameInfo import GameInfo
            obj = GameInfo()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # GameTickPacket
    def TileInformation(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            x = self._tab.Vector(o)
            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
            x = self._tab.Indirect(x)
            from .DropshotTile import DropshotTile
            obj = DropshotTile()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # GameTickPacket
    def TileInformationLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # GameTickPacket
    def Teams(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            x = self._tab.Vector(o)
            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
            x = self._tab.Indirect(x)
            from .TeamInfo import TeamInfo
            obj = TeamInfo()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # GameTickPacket
    def TeamsLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

def GameTickPacketStart(builder): builder.StartObject(6)
def GameTickPacketAddPlayers(builder, players): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(players), 0)
def GameTickPacketStartPlayersVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def GameTickPacketAddBoostPadStates(builder, boostPadStates): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(boostPadStates), 0)
def GameTickPacketStartBoostPadStatesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def GameTickPacketAddBall(builder, ball): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(ball), 0)
def GameTickPacketAddGameInfo(builder, gameInfo): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(gameInfo), 0)
def GameTickPacketAddTileInformation(builder, tileInformation): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(tileInformation), 0)
def GameTickPacketStartTileInformationVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def GameTickPacketAddTeams(builder, teams): builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(teams), 0)
def GameTickPacketStartTeamsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def GameTickPacketEnd(builder): return builder.EndObject()
