# automatically generated by the FlatBuffers compiler, do not modify

# namespace: aghast_generated

import flatbuffers

# ///////////////////////////////////////////////// objects and collections
class Collection(object):
    __slots__ = ['_tab']

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

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

    # Collection
    def Lookup(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.String(a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
        return ""

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

    # Collection
    def Objects(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            x = self._tab.Vector(o)
            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
            x = self._tab.Indirect(x)
            from .Object import Object
            obj = Object()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # Collection
    def ObjectsLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # Collection
    def Axis(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            x = self._tab.Vector(o)
            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
            x = self._tab.Indirect(x)
            from .Axis import Axis
            obj = Axis()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # Collection
    def AxisLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

def CollectionStart(builder): builder.StartObject(3)
def CollectionAddLookup(builder, lookup): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(lookup), 0)
def CollectionStartLookupVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def CollectionAddObjects(builder, objects): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(objects), 0)
def CollectionStartObjectsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def CollectionAddAxis(builder, axis): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(axis), 0)
def CollectionStartAxisVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def CollectionEnd(builder): return builder.EndObject()
