static int pyResponderModifier_Cmd_setMsg(pyResponderModifier_Cmd* self, PyObject* value, void*) {
    if (value == NULL || !pyMessage_Check(value)) {
        PyErr_SetString(PyExc_TypeError, "msg should be a plMessage");
        return -1;
    }
    self->fThis->fMsg = ((pyMessage*)value)->fThis;
    ((pyMessage*)value)->fPyOwned = false;
    return 0;
}
static PyObject* pyMessageWithCallbacks_addCallback(pyMessageWithCallbacks* self, PyObject* args) {
    PyObject* msg;
    if (!(PyArg_ParseTuple(args, "O", &msg) && pyMessage_Check(msg))) {
        PyErr_SetString(PyExc_TypeError, "addCallback expects a plMessage");
        return NULL;
    }
    self->fThis->addCallback(((pyMessage*)msg)->fThis);
    ((pyMessage*)msg)->fPyOwned = false;
    Py_INCREF(Py_None);
    return Py_None;
}
Beispiel #3
0
static PyObject* pyLogicModBase_addCommand(pyLogicModBase* self, PyObject* args) {
    pyMessage* msg;
    if (!PyArg_ParseTuple(args, "O", &msg)) {
        PyErr_SetString(PyExc_TypeError, "addCommand expects a plMessage");
        return NULL;
    }
    if (!pyMessage_Check((PyObject*)msg)) {
        PyErr_SetString(PyExc_TypeError, "addCommand expects a plMessage");
        return NULL;
    }
    plLogicModBase::Convert(IConvert((pyCreatable*)self))->addCommand(msg->fThis);
    msg->fPyOwned = false;
    Py_INCREF(Py_None);
    return Py_None;
}
static int pyResponderModifier_Cmd___init__(pyResponderModifier_Cmd* self, PyObject* args, PyObject* /*kwds*/) {
    pyMessage* msg = NULL;
    int waitOn = -1;
    if (!PyArg_ParseTuple(args, "|Oi", &msg, &waitOn)) {
        PyErr_SetString(PyExc_TypeError, "__init__ expects a message and an int");
        return -1;
    }
    if (msg != NULL && !pyMessage_Check((PyObject*)msg)) {
        PyErr_SetString(PyExc_TypeError, "__init__ expects a message and an int");
        return -1;
    }
    if (msg != NULL) {
        self->fThis->fMsg = msg->fThis;
        msg->fPyOwned = false;
    } else {
        self->fThis->fMsg = NULL;
    }
    self->fThis->fWaitOn = waitOn;
    return 0;
}