# automatically generated by the FlatBuffers compiler, do not modify

# namespace: isp

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

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

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

    @classmethod
    def GetRootAsInfo(cls, buf, offset=0):
        """This method is deprecated. Please switch to GetRootAs."""
        return cls.GetRootAs(buf, offset)
    @classmethod
    def InfoBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
        return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x49\x53\x50\x46", size_prefixed=size_prefixed)

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

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

    # Info
    def Collision(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

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

    # Info
    def ExpertAction(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            x = o + self._tab.Pos
            from communications.isp.Action import Action
            obj = Action()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # Info
    def Outcome(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            from communications.isp.Tensor import Tensor
            obj = Tensor()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # Info
    def NextWaypointDistance(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos)
        return 0.0

    # Info
    def DistanceToGoal(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos)
        return 0.0

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

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

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

def InfoStart(builder): builder.StartObject(10)
def Start(builder):
    return InfoStart(builder)
def InfoAddInvasion(builder, invasion): builder.PrependBoolSlot(0, invasion, 0)
def AddInvasion(builder, invasion):
    return InfoAddInvasion(builder, invasion)
def InfoAddCollision(builder, collision): builder.PrependBoolSlot(1, collision, 0)
def AddCollision(builder, collision):
    return InfoAddCollision(builder, collision)
def InfoAddGear(builder, gear): builder.PrependInt32Slot(2, gear, 0)
def AddGear(builder, gear):
    return InfoAddGear(builder, gear)
def InfoAddExpertAction(builder, expertAction): builder.PrependStructSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(expertAction), 0)
def AddExpertAction(builder, expertAction):
    return InfoAddExpertAction(builder, expertAction)
def InfoAddOutcome(builder, outcome): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(outcome), 0)
def AddOutcome(builder, outcome):
    return InfoAddOutcome(builder, outcome)
def InfoAddNextWaypointDistance(builder, nextWaypointDistance): builder.PrependFloat64Slot(5, nextWaypointDistance, 0.0)
def AddNextWaypointDistance(builder, nextWaypointDistance):
    return InfoAddNextWaypointDistance(builder, nextWaypointDistance)
def InfoAddDistanceToGoal(builder, distanceToGoal): builder.PrependFloat64Slot(6, distanceToGoal, 0.0)
def AddDistanceToGoal(builder, distanceToGoal):
    return InfoAddDistanceToGoal(builder, distanceToGoal)
def InfoAddWaypointsFound(builder, waypointsFound): builder.PrependInt32Slot(7, waypointsFound, 0)
def AddWaypointsFound(builder, waypointsFound):
    return InfoAddWaypointsFound(builder, waypointsFound)
def InfoAddWaypointsTotal(builder, waypointsTotal): builder.PrependInt32Slot(8, waypointsTotal, 0)
def AddWaypointsTotal(builder, waypointsTotal):
    return InfoAddWaypointsTotal(builder, waypointsTotal)
def InfoAddWaypointsRemaining(builder, waypointsRemaining): builder.PrependInt32Slot(9, waypointsRemaining, 0)
def AddWaypointsRemaining(builder, waypointsRemaining):
    return InfoAddWaypointsRemaining(builder, waypointsRemaining)
def InfoEnd(builder): return builder.EndObject()
def End(builder):
    return InfoEnd(builder)