# automatically generated by the FlatBuffers compiler, do not modify

# namespace: flat

import flatbuffers

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

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

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

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

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

    # GoalInfo
    def Direction(self):
        o = 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

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

    # GoalInfo
    def Height(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos)
        return 0.0

def GoalInfoStart(builder): builder.StartObject(5)
def GoalInfoAddTeamNum(builder, teamNum): builder.PrependInt32Slot(0, teamNum, 0)
def GoalInfoAddLocation(builder, location): builder.PrependStructSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(location), 0)
def GoalInfoAddDirection(builder, direction): builder.PrependStructSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(direction), 0)
def GoalInfoAddWidth(builder, width): builder.PrependFloat32Slot(3, width, 0.0)
def GoalInfoAddHeight(builder, height): builder.PrependFloat32Slot(4, height, 0.0)
def GoalInfoEnd(builder): return builder.EndObject()
