# automatically generated by the FlatBuffers compiler, do not modify

# namespace: isp

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

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

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

    @classmethod
    def WorldParametersBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
        return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x49\x53\x50\x46", size_prefixed=size_prefixed)

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

    # WorldParameters
    def Carlatown(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

    # WorldParameters
    def TrafficCount(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

    # WorldParameters
    def PedestrianCount(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

def WorldParametersStart(builder): builder.StartObject(3)
def WorldParametersAddCarlatown(builder, carlatown): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(carlatown), 0)
def WorldParametersAddTrafficCount(builder, trafficCount): builder.PrependInt32Slot(1, trafficCount, 0)
def WorldParametersAddPedestrianCount(builder, pedestrianCount): builder.PrependInt32Slot(2, pedestrianCount, 0)
def WorldParametersEnd(builder): return builder.EndObject()
