# automatically generated by the FlatBuffers compiler, do not modify

# namespace: AOC

import flatbuffers

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

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

    # Object
    def Id(self): return self._tab.Get(flatbuffers.number_types.Int32Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(0))
    # Object
    def CreatedTime(self): return self._tab.Get(flatbuffers.number_types.Uint32Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(4))
    # Object
    def MasterObjectClass(self): return self._tab.Get(flatbuffers.number_types.Int8Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(8))
    # Object
    def MasterObjectId(self): return self._tab.Get(flatbuffers.number_types.Uint16Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(10))
    # Object
    def State(self): return self._tab.Get(flatbuffers.number_types.Int8Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(12))
    # Object
    def OwnerId(self): return self._tab.Get(flatbuffers.number_types.Uint8Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(13))
    # Object
    def Position(self):
        from .Position import Position
        obj = Position()
        obj.Init(self._tab.Bytes, self._tab.Pos + 16)
        return obj

    # Object
    def Idle(self): return self._tab.Get(flatbuffers.number_types.BoolFlags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(28))
    # Object
    def CurrentlyCreatingMasterObjectId(self): return self._tab.Get(flatbuffers.number_types.Uint16Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(30))
    # Object
    def CurrentlyResearchingTechId(self): return self._tab.Get(flatbuffers.number_types.Uint16Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(32))
    # Object
    def KilledByUnitId(self): return self._tab.Get(flatbuffers.number_types.Int32Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(36))
    # Object
    def KilledByPlayerId(self): return self._tab.Get(flatbuffers.number_types.Int8Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(40))
    # Object
    def KilledTime(self): return self._tab.Get(flatbuffers.number_types.Uint32Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(44))
    # Object
    def DeletedByOwner(self): return self._tab.Get(flatbuffers.number_types.BoolFlags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(48))
    # Object
    def BuildingPercentComplete(self): return self._tab.Get(flatbuffers.number_types.Float32Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(52))
    # Object
    def BuildingStartTime(self): return self._tab.Get(flatbuffers.number_types.Uint32Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(56))
    # Object
    def BuildingCompleteTime(self): return self._tab.Get(flatbuffers.number_types.Uint32Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(60))
    # Object
    def CumulativeIdleTime(self): return self._tab.Get(flatbuffers.number_types.Float32Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(64))

def CreateObject(builder, id, createdTime, masterObjectClass, masterObjectId, state, ownerId, position_x, position_y, position_z, idle, currentlyCreatingMasterObjectId, currentlyResearchingTechId, killedByUnitId, killedByPlayerId, killedTime, deletedByOwner, buildingPercentComplete, buildingStartTime, buildingCompleteTime, cumulativeIdleTime):
    builder.Prep(4, 68)
    builder.PrependFloat32(cumulativeIdleTime)
    builder.PrependUint32(buildingCompleteTime)
    builder.PrependUint32(buildingStartTime)
    builder.PrependFloat32(buildingPercentComplete)
    builder.Pad(3)
    builder.PrependBool(deletedByOwner)
    builder.PrependUint32(killedTime)
    builder.Pad(3)
    builder.PrependInt8(killedByPlayerId)
    builder.PrependInt32(killedByUnitId)
    builder.Pad(2)
    builder.PrependUint16(currentlyResearchingTechId)
    builder.PrependUint16(currentlyCreatingMasterObjectId)
    builder.Pad(1)
    builder.PrependBool(idle)
    builder.Prep(4, 12)
    builder.PrependFloat32(position_z)
    builder.PrependFloat32(position_y)
    builder.PrependFloat32(position_x)
    builder.Pad(2)
    builder.PrependUint8(ownerId)
    builder.PrependInt8(state)
    builder.PrependUint16(masterObjectId)
    builder.Pad(1)
    builder.PrependInt8(masterObjectClass)
    builder.PrependUint32(createdTime)
    builder.PrependInt32(id)
    return builder.Offset()
