# automatically generated by the FlatBuffers compiler, do not modify

# namespace: Packets

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

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

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

    @classmethod
    def GetRootAsQueryObjectInteractableParam(cls, buf, offset=0):
        """This method is deprecated. Please switch to GetRootAs."""
        return cls.GetRootAs(buf, offset)
    # QueryObjectInteractableParam
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

    # QueryObjectInteractableParam
    def ObjectId(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

    # QueryObjectInteractableParam
    def CheckMoving(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
        return False

    # QueryObjectInteractableParam
    def CheckRaycast(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
        return False

def QueryObjectInteractableParamStart(builder): builder.StartObject(3)
def Start(builder):
    return QueryObjectInteractableParamStart(builder)
def QueryObjectInteractableParamAddObjectId(builder, objectId): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(objectId), 0)
def AddObjectId(builder, objectId):
    return QueryObjectInteractableParamAddObjectId(builder, objectId)
def QueryObjectInteractableParamAddCheckMoving(builder, checkMoving): builder.PrependBoolSlot(1, checkMoving, 0)
def AddCheckMoving(builder, checkMoving):
    return QueryObjectInteractableParamAddCheckMoving(builder, checkMoving)
def QueryObjectInteractableParamAddCheckRaycast(builder, checkRaycast): builder.PrependBoolSlot(2, checkRaycast, 0)
def AddCheckRaycast(builder, checkRaycast):
    return QueryObjectInteractableParamAddCheckRaycast(builder, checkRaycast)
def QueryObjectInteractableParamEnd(builder): return builder.EndObject()
def End(builder):
    return QueryObjectInteractableParamEnd(builder)

class QueryObjectInteractableParamT(object):

    # QueryObjectInteractableParamT
    def __init__(self):
        self.objectId = None  # type: str
        self.checkMoving = False  # type: bool
        self.checkRaycast = False  # type: bool

    @classmethod
    def InitFromBuf(cls, buf, pos):
        queryObjectInteractableParam = QueryObjectInteractableParam()
        queryObjectInteractableParam.Init(buf, pos)
        return cls.InitFromObj(queryObjectInteractableParam)

    @classmethod
    def InitFromPackedBuf(cls, buf, pos=0):
        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
        return cls.InitFromBuf(buf, pos+n)

    @classmethod
    def InitFromObj(cls, queryObjectInteractableParam):
        x = QueryObjectInteractableParamT()
        x._UnPack(queryObjectInteractableParam)
        return x

    # QueryObjectInteractableParamT
    def _UnPack(self, queryObjectInteractableParam):
        if queryObjectInteractableParam is None:
            return
        self.objectId = queryObjectInteractableParam.ObjectId()
        self.checkMoving = queryObjectInteractableParam.CheckMoving()
        self.checkRaycast = queryObjectInteractableParam.CheckRaycast()

    # QueryObjectInteractableParamT
    def Pack(self, builder):
        if self.objectId is not None:
            objectId = builder.CreateString(self.objectId)
        QueryObjectInteractableParamStart(builder)
        if self.objectId is not None:
            QueryObjectInteractableParamAddObjectId(builder, objectId)
        QueryObjectInteractableParamAddCheckMoving(builder, self.checkMoving)
        QueryObjectInteractableParamAddCheckRaycast(builder, self.checkRaycast)
        queryObjectInteractableParam = QueryObjectInteractableParamEnd(builder)
        return queryObjectInteractableParam
