Changeset View
Changeset View
Standalone View
Standalone View
source/gameengine/Expressions/ListValue.cpp
| Show First 20 Lines • Show All 577 Lines • ▼ Show 20 Lines | |||||
| PyObject *CListValue::Pyappend(PyObject *value) | PyObject *CListValue::Pyappend(PyObject *value) | ||||
| { | { | ||||
| CValue *objval = ConvertPythonToValue(value, true, "CList.append(i): CValueList, "); | CValue *objval = ConvertPythonToValue(value, true, "CList.append(i): CValueList, "); | ||||
| if (!objval) /* ConvertPythonToValue sets the error */ | if (!objval) /* ConvertPythonToValue sets the error */ | ||||
| return NULL; | return NULL; | ||||
| if (!BGE_PROXY_PYOWNS(m_proxy)) { | if (!BGE_PROXY_PYOWNS(m_proxy)) { | ||||
| PyErr_SetString(PyExc_TypeError, "CList.append(i): this CValueList is used internally for the game engine and can't be modified"); | PyErr_SetString(PyExc_TypeError, | ||||
| "CList.append(i): internal values can't be modified"); | |||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| Add(objval); | Add(objval); | ||||
| Py_RETURN_NONE; | Py_RETURN_NONE; | ||||
| } | } | ||||
| PyObject *CListValue::Pyreverse() | PyObject *CListValue::Pyreverse() | ||||
| { | { | ||||
| if (!BGE_PROXY_PYOWNS(m_proxy)) { | |||||
| PyErr_SetString(PyExc_TypeError, | |||||
| "CList.reverse(): internal values can't be modified"); | |||||
| return NULL; | |||||
| } | |||||
| std::reverse(m_pValueArray.begin(),m_pValueArray.end()); | std::reverse(m_pValueArray.begin(),m_pValueArray.end()); | ||||
| Py_RETURN_NONE; | Py_RETURN_NONE; | ||||
| } | } | ||||
| PyObject *CListValue::Pyindex(PyObject *value) | PyObject *CListValue::Pyindex(PyObject *value) | ||||
| { | { | ||||
| PyObject *result = NULL; | PyObject *result = NULL; | ||||
| ▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines | |||||