# automatically generated by the FlatBuffers compiler, do not modify

# namespace: API

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

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

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

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

    # AddVariable
    def CollectionId(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            x = o + self._tab.Pos
            from SEAScope.API.RenderableId import RenderableId
            obj = RenderableId()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # AddVariable
    def Variable(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            from SEAScope.API.Variable import Variable
            obj = Variable()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

def AddVariableStart(builder): builder.StartObject(2)
def AddVariableAddCollectionId(builder, collectionId): builder.PrependStructSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(collectionId), 0)
def AddVariableAddVariable(builder, variable): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(variable), 0)
def AddVariableEnd(builder): return builder.EndObject()
