# automatically generated by the FlatBuffers compiler, do not modify

# namespace: fbs

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

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

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

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

    # InventoryItem
    def Glyph(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos)
        return 0

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

    # InventoryItem
    def Letter(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
        return 0

    # InventoryItem
    def ObjectClass(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
        return 0

    # InventoryItem
    def ObjectClassName(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

def InventoryItemStart(builder): builder.StartObject(5)
def InventoryItemAddGlyph(builder, glyph): builder.PrependInt16Slot(0, glyph, 0)
def InventoryItemAddStr(builder, str): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(str), 0)
def InventoryItemAddLetter(builder, letter): builder.PrependInt8Slot(2, letter, 0)
def InventoryItemAddObjectClass(builder, objectClass): builder.PrependInt8Slot(3, objectClass, 0)
def InventoryItemAddObjectClassName(builder, objectClassName): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(objectClassName), 0)
def InventoryItemEnd(builder): return builder.EndObject()
