# automatically generated by the FlatBuffers compiler, do not modify

# namespace: flat

import flatbuffers

# /// Rigid body state for the ball.
class BallRigidBodyState(object):
    __slots__ = ['_tab']

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

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

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

def BallRigidBodyStateStart(builder): builder.StartObject(1)
def BallRigidBodyStateAddState(builder, state): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(state), 0)
def BallRigidBodyStateEnd(builder): return builder.EndObject()
