# automatically generated by the FlatBuffers compiler, do not modify

# namespace: flat

import flatbuffers

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

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

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

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

    # Vector3Partial
    def Y(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            x = o + self._tab.Pos
            from .Float import Float
            obj = Float()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # Vector3Partial
    def Z(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            x = o + self._tab.Pos
            from .Float import Float
            obj = Float()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

def Vector3PartialStart(builder): builder.StartObject(3)
def Vector3PartialAddX(builder, x): builder.PrependStructSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(x), 0)
def Vector3PartialAddY(builder, y): builder.PrependStructSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(y), 0)
def Vector3PartialAddZ(builder, z): builder.PrependStructSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(z), 0)
def Vector3PartialEnd(builder): return builder.EndObject()
