# automatically generated by the FlatBuffers compiler, do not modify

# namespace: flat

import flatbuffers

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

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

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

# /// A list of places the ball will be at specific times in the future.
# /// It is guaranteed to sorted so that time increases with each slice.
# /// It is NOT guaranteed to have a consistent amount of time between slices.
    # BallPrediction
    def Slices(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 .PredictionSlice import PredictionSlice
            obj = PredictionSlice()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

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

def BallPredictionStart(builder): builder.StartObject(1)
def BallPredictionAddSlices(builder, slices): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(slices), 0)
def BallPredictionStartSlicesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def BallPredictionEnd(builder): return builder.EndObject()
