# automatically generated by the FlatBuffers compiler, do not modify

# namespace: FBOutput

import tdw.flatbuffers

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

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

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

    # Category
    def Color(self):
        o = tdw.flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            x = o + self._tab.Pos
            from .Color import Color
            obj = Color()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # Category
    def Name(self):
        o = tdw.flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

def CategoryStart(builder): builder.StartObject(2)
def CategoryAddColor(builder, color): builder.PrependStructSlot(0, tdw.flatbuffers.number_types.UOffsetTFlags.py_type(color), 0)
def CategoryAddName(builder, name): builder.PrependUOffsetTRelativeSlot(1, tdw.flatbuffers.number_types.UOffsetTFlags.py_type(name), 0)
def CategoryEnd(builder): return builder.EndObject()
