# automatically generated by the FlatBuffers compiler, do not modify

# namespace: generated

class Param(object):
    NONE = 0
    Packets_HelloParam = 1
    Packets_QueryScreenParam = 2
    Packets_FindObjectsParam = 3
    Packets_QueryObjectInteractableParam = 4
    Packets_ActionsParam = 5
    Packets_ExecuteRpcParam = 6
    Packets_InspectObjectOnScreenParam = 7
    Packets_InspectObjectWithIdParam = 8
    Packets_DumpObjectsHierarchyParam = 9
    Packets_ChangeConfigurationParam = 10
    Packets_QueryProfileParam = 11

def ParamCreator(unionType, table):
    from flatbuffers.table import Table
    if not isinstance(table, Table):
        return None
    if unionType == Param().Packets_HelloParam:
        import gamium.protocol.generated.Packets.HelloParam
        return gamium.protocol.generated.Packets.HelloParam.HelloParamT.InitFromBuf(table.Bytes, table.Pos)
    if unionType == Param().Packets_QueryScreenParam:
        import gamium.protocol.generated.Packets.QueryScreenParam
        return gamium.protocol.generated.Packets.QueryScreenParam.QueryScreenParamT.InitFromBuf(table.Bytes, table.Pos)
    if unionType == Param().Packets_FindObjectsParam:
        import gamium.protocol.generated.Packets.FindObjectsParam
        return gamium.protocol.generated.Packets.FindObjectsParam.FindObjectsParamT.InitFromBuf(table.Bytes, table.Pos)
    if unionType == Param().Packets_QueryObjectInteractableParam:
        import gamium.protocol.generated.Packets.QueryObjectInteractableParam
        return gamium.protocol.generated.Packets.QueryObjectInteractableParam.QueryObjectInteractableParamT.InitFromBuf(table.Bytes, table.Pos)
    if unionType == Param().Packets_ActionsParam:
        import gamium.protocol.generated.Packets.ActionsParam
        return gamium.protocol.generated.Packets.ActionsParam.ActionsParamT.InitFromBuf(table.Bytes, table.Pos)
    if unionType == Param().Packets_ExecuteRpcParam:
        import gamium.protocol.generated.Packets.ExecuteRpcParam
        return gamium.protocol.generated.Packets.ExecuteRpcParam.ExecuteRpcParamT.InitFromBuf(table.Bytes, table.Pos)
    if unionType == Param().Packets_InspectObjectOnScreenParam:
        import gamium.protocol.generated.Packets.InspectObjectOnScreenParam
        return gamium.protocol.generated.Packets.InspectObjectOnScreenParam.InspectObjectOnScreenParamT.InitFromBuf(table.Bytes, table.Pos)
    if unionType == Param().Packets_InspectObjectWithIdParam:
        import gamium.protocol.generated.Packets.InspectObjectWithIdParam
        return gamium.protocol.generated.Packets.InspectObjectWithIdParam.InspectObjectWithIdParamT.InitFromBuf(table.Bytes, table.Pos)
    if unionType == Param().Packets_DumpObjectsHierarchyParam:
        import gamium.protocol.generated.Packets.DumpObjectsHierarchyParam
        return gamium.protocol.generated.Packets.DumpObjectsHierarchyParam.DumpObjectsHierarchyParamT.InitFromBuf(table.Bytes, table.Pos)
    if unionType == Param().Packets_ChangeConfigurationParam:
        import gamium.protocol.generated.Packets.ChangeConfigurationParam
        return gamium.protocol.generated.Packets.ChangeConfigurationParam.ChangeConfigurationParamT.InitFromBuf(table.Bytes, table.Pos)
    if unionType == Param().Packets_QueryProfileParam:
        import gamium.protocol.generated.Packets.QueryProfileParam
        return gamium.protocol.generated.Packets.QueryProfileParam.QueryProfileParamT.InitFromBuf(table.Bytes, table.Pos)
    return None
