# automatically generated by the FlatBuffers compiler, do not modify

# namespace: FBOutput

import tdw.flatbuffers

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

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

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

    # PointLight
    def Intensity(self):
        o = tdw.flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.Get(tdw.flatbuffers.number_types.Float32Flags, o + self._tab.Pos)
        return 0.0

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

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

    # PointLight
    def Range(self):
        o = tdw.flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.Get(tdw.flatbuffers.number_types.Float32Flags, o + self._tab.Pos)
        return 0.0

def PointLightStart(builder): builder.StartObject(4)
def PointLightAddIntensity(builder, intensity): builder.PrependFloat32Slot(0, intensity, 0.0)
def PointLightAddColor(builder, color): builder.PrependStructSlot(1, tdw.flatbuffers.number_types.UOffsetTFlags.py_type(color), 0)
def PointLightAddPosition(builder, position): builder.PrependStructSlot(2, tdw.flatbuffers.number_types.UOffsetTFlags.py_type(position), 0)
def PointLightAddRange(builder, range): builder.PrependFloat32Slot(3, range, 0.0)
def PointLightEnd(builder): return builder.EndObject()
