# automatically generated by the FlatBuffers compiler, do not modify

# namespace: isp

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

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

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

    @classmethod
    def GetRootAsScenarioParameters(cls, buf, offset=0):
        """This method is deprecated. Please switch to GetRootAs."""
        return cls.GetRootAs(buf, offset)
    @classmethod
    def ScenarioParametersBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
        return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x49\x53\x50\x46", size_prefixed=size_prefixed)

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

    # ScenarioParameters
    def EgoStart(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            from communications.isp.Tensor import Tensor
            obj = Tensor()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

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

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

    # ScenarioParameters
    def CameraLocationVariation(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            x = o + self._tab.Pos
            from communications.isp.Location import Location
            obj = Location()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # ScenarioParameters
    def CameraOrientationVariation(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            x = o + self._tab.Pos
            from communications.isp.Rotation import Rotation
            obj = Rotation()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

def ScenarioParametersStart(builder): builder.StartObject(5)
def Start(builder):
    return ScenarioParametersStart(builder)
def ScenarioParametersAddEgoStart(builder, egoStart): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(egoStart), 0)
def AddEgoStart(builder, egoStart):
    return ScenarioParametersAddEgoStart(builder, egoStart)
def ScenarioParametersAddMaxNumAgents(builder, maxNumAgents): builder.PrependInt32Slot(1, maxNumAgents, 0)
def AddMaxNumAgents(builder, maxNumAgents):
    return ScenarioParametersAddMaxNumAgents(builder, maxNumAgents)
def ScenarioParametersAddMaxScenLen(builder, maxScenLen): builder.PrependInt32Slot(2, maxScenLen, 0)
def AddMaxScenLen(builder, maxScenLen):
    return ScenarioParametersAddMaxScenLen(builder, maxScenLen)
def ScenarioParametersAddCameraLocationVariation(builder, cameraLocationVariation): builder.PrependStructSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(cameraLocationVariation), 0)
def AddCameraLocationVariation(builder, cameraLocationVariation):
    return ScenarioParametersAddCameraLocationVariation(builder, cameraLocationVariation)
def ScenarioParametersAddCameraOrientationVariation(builder, cameraOrientationVariation): builder.PrependStructSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(cameraOrientationVariation), 0)
def AddCameraOrientationVariation(builder, cameraOrientationVariation):
    return ScenarioParametersAddCameraOrientationVariation(builder, cameraOrientationVariation)
def ScenarioParametersEnd(builder): return builder.EndObject()
def End(builder):
    return ScenarioParametersEnd(builder)