# automatically generated by the FlatBuffers compiler, do not modify

# namespace: FBOutput

import tdw.flatbuffers

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

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

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

    # Environments
    def Envs(self, j):
        o = tdw.flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            x = self._tab.Vector(o)
            x += tdw.flatbuffers.number_types.UOffsetTFlags.py_type(j) * 28
            from .Environment import Environment
            obj = Environment()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

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

def EnvironmentsStart(builder): builder.StartObject(1)
def EnvironmentsAddEnvs(builder, envs): builder.PrependUOffsetTRelativeSlot(0, tdw.flatbuffers.number_types.UOffsetTFlags.py_type(envs), 0)
def EnvironmentsStartEnvsVector(builder, numElems): return builder.StartVector(28, numElems, 4)
def EnvironmentsEnd(builder): return builder.EndObject()
