# automatically generated by the FlatBuffers compiler, do not modify

# namespace: flat

import flatbuffers

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

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

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

    # RenderGroup
    def RenderMessages(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 .RenderMessage import RenderMessage
            obj = RenderMessage()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

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

# /// The id of the render group
    # RenderGroup
    def Id(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

def RenderGroupStart(builder): builder.StartObject(2)
def RenderGroupAddRenderMessages(builder, renderMessages): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(renderMessages), 0)
def RenderGroupStartRenderMessagesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def RenderGroupAddId(builder, id): builder.PrependInt32Slot(1, id, 0)
def RenderGroupEnd(builder): return builder.EndObject()
