# automatically generated by the FlatBuffers compiler, do not modify

# namespace: isp

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

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

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

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

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

    # Initialize
    def Scenario(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

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

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

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

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

def InitializeStart(builder): builder.StartObject(5)
def Start(builder):
    return InitializeStart(builder)
def InitializeAddScenario(builder, scenario): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(scenario), 0)
def AddScenario(builder, scenario):
    return InitializeAddScenario(builder, scenario)
def InitializeAddScenarioParameters(builder, scenarioParameters): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(scenarioParameters), 0)
def AddScenarioParameters(builder, scenarioParameters):
    return InitializeAddScenarioParameters(builder, scenarioParameters)
def InitializeAddWorldParameters(builder, worldParameters): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(worldParameters), 0)
def AddWorldParameters(builder, worldParameters):
    return InitializeAddWorldParameters(builder, worldParameters)
def InitializeAddVehiclePhysics(builder, vehiclePhysics): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(vehiclePhysics), 0)
def AddVehiclePhysics(builder, vehiclePhysics):
    return InitializeAddVehiclePhysics(builder, vehiclePhysics)
def InitializeAddSensors(builder, sensors): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(sensors), 0)
def AddSensors(builder, sensors):
    return InitializeAddSensors(builder, sensors)
def InitializeEnd(builder): return builder.EndObject()
def End(builder):
    return InitializeEnd(builder)