Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2009-06-28 15:22:26 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-06-28 15:22:26 +0400
commit6b9f3b5f5c8d918585e01461a6202ae3df2df621 (patch)
tree655463247dee5167a8b7063bc6705eac84701bed /source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp
parent6998a0f47b673591f8561cda35d50e93979de32c (diff)
BGE Python API
Remove the last of the odd C++/python wrapper code from http://www.python.org/doc/PyCPP.html (~1998) * Use python subclasses rather then having fake subclassing through get/set attributes calling parent types. * PyObject getset arrays are created while initializing the types, converted from our own attribute arrays. This way python deals with subclasses and we dont have to define getattro or setattro functions for each type. * GameObjects and Scenes no longer have attribute access to properties. only dictionary style access - ob['prop'] * remove each class's get/set/dir functions. * remove isA() methods, can use PyObject_TypeCheck() in C and issubclass() in python. * remove Parents[] array for each C++ class, was only used for isA() and wasnt correct in quite a few cases. * remove PyTypeObject that was being passed as the last argument to each class (the parent classes too). TODO - * Light and VertexProxy need to be converted to using attributes. * memory for getset arrays is never freed, not that bad since its will only allocates once.
Diffstat (limited to 'source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp')
-rw-r--r--source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp40
1 files changed, 12 insertions, 28 deletions
diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp
index 63773352d96..60805916a20 100644
--- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp
+++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp
@@ -41,9 +41,8 @@ KX_NetworkMessageActuator::KX_NetworkMessageActuator(
const STR_String &toPropName,
const STR_String &subject,
int bodyType,
- const STR_String &body,
- PyTypeObject* T) :
- SCA_IActuator(gameobj,T),
+ const STR_String &body) :
+ SCA_IActuator(gameobj),
m_networkscene(networkscene),
m_toPropName(toPropName),
m_subject(subject),
@@ -119,18 +118,15 @@ PyTypeObject KX_NetworkMessageActuator::Type = {
0,
py_base_repr,
0,0,0,0,0,0,
- py_base_getattro,
- py_base_setattro,
- 0,0,0,0,0,0,0,0,0,
- Methods
-};
-
-PyParentObject KX_NetworkMessageActuator::Parents[] = {
- &KX_NetworkMessageActuator::Type,
- &SCA_IActuator::Type,
- &SCA_ILogicBrick::Type,
- &CValue::Type,
- NULL
+ NULL, //py_base_getattro,
+ NULL, //py_base_setattro,
+ 0,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ 0,0,0,0,0,0,0,
+ Methods,
+ 0,
+ 0,
+ &SCA_IActuator::Type
};
PyMethodDef KX_NetworkMessageActuator::Methods[] = {
@@ -155,18 +151,6 @@ PyAttributeDef KX_NetworkMessageActuator::Attributes[] = {
{ NULL } //Sentinel
};
-PyObject* KX_NetworkMessageActuator::py_getattro(PyObject *attr) {
- py_getattro_up(SCA_IActuator);
-}
-
-PyObject* KX_NetworkMessageActuator::py_getattro_dict() {
- py_getattro_dict_up(SCA_IActuator);
-}
-
-int KX_NetworkMessageActuator::py_setattro(PyObject *attr, PyObject *value) {
- py_setattro_up(SCA_IActuator);
-}
-
// Deprecated ----->
// 1. SetToPropName
PyObject* KX_NetworkMessageActuator::PySetToPropName(
@@ -240,4 +224,4 @@ PyObject* KX_NetworkMessageActuator::PySetBody(
Py_RETURN_NONE;
}
-// <----- Deprecated \ No newline at end of file
+// <----- Deprecated