diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-02-26 12:04:06 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-02-26 12:04:06 +0300 |
commit | c785532becca59aa2d1b3ae67784b7ac2b733ec2 (patch) | |
tree | 307355d1dec68595375840ec9546f1e9c8c7a535 /source/gameengine/GameLogic | |
parent | 936a6eeda87bfd36ada735e5edac06f161a5de25 (diff) |
Py BGE API
Python dir(ob) for game types now includes attributes names,
* Use "__dict__" rather then "__methods__" attribute to be Python 3.0 compatible
* Added _getattr_dict() for getting the method and attribute names from a PyObject, rather then building it in the macro.
* Added place holder *::Attribute array, needed for the _getattr_up macro.
Diffstat (limited to 'source/gameengine/GameLogic')
10 files changed, 38 insertions, 0 deletions
diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp index 6fcb1be654c..7bf051f2b5c 100644 --- a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp +++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp @@ -113,6 +113,9 @@ PyMethodDef SCA_2DFilterActuator::Methods[] = { {NULL,NULL} }; +PyAttributeDef SCA_2DFilterActuator::Attributes[] = { + { NULL } //Sentinel +}; PyObject* SCA_2DFilterActuator::_getattr(const char *attr) { _getattr_up(SCA_IActuator); diff --git a/source/gameengine/GameLogic/SCA_ANDController.cpp b/source/gameengine/GameLogic/SCA_ANDController.cpp index 98a3c2e96cd..b67ef7dabaf 100644 --- a/source/gameengine/GameLogic/SCA_ANDController.cpp +++ b/source/gameengine/GameLogic/SCA_ANDController.cpp @@ -137,6 +137,10 @@ PyMethodDef SCA_ANDController::Methods[] = { {NULL,NULL} //Sentinel }; +PyAttributeDef SCA_ANDController::Attributes[] = { + { NULL } //Sentinel +}; + PyObject* SCA_ANDController::_getattr(const char *attr) { _getattr_up(SCA_IController); } diff --git a/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp b/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp index 76aa328aa48..154f0ad8cef 100644 --- a/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp +++ b/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp @@ -135,6 +135,10 @@ PyMethodDef SCA_AlwaysSensor::Methods[] = { {NULL,NULL} //Sentinel }; +PyAttributeDef SCA_AlwaysSensor::Attributes[] = { + { NULL } //Sentinel +}; + PyObject* SCA_AlwaysSensor::_getattr(const char *attr) { _getattr_up(SCA_ISensor); } diff --git a/source/gameengine/GameLogic/SCA_IObject.cpp b/source/gameengine/GameLogic/SCA_IObject.cpp index e5ca26eac85..d8f5f3eede5 100644 --- a/source/gameengine/GameLogic/SCA_IObject.cpp +++ b/source/gameengine/GameLogic/SCA_IObject.cpp @@ -407,6 +407,9 @@ PyMethodDef SCA_IObject::Methods[] = { {NULL,NULL} //Sentinel }; +PyAttributeDef SCA_IObject::Attributes[] = { + { NULL } //Sentinel +}; PyObject* SCA_IObject::_getattr(const char *attr) { diff --git a/source/gameengine/GameLogic/SCA_NANDController.cpp b/source/gameengine/GameLogic/SCA_NANDController.cpp index 0efa8da153a..18426d75582 100644 --- a/source/gameengine/GameLogic/SCA_NANDController.cpp +++ b/source/gameengine/GameLogic/SCA_NANDController.cpp @@ -137,6 +137,10 @@ PyMethodDef SCA_NANDController::Methods[] = { {NULL,NULL} //Sentinel }; +PyAttributeDef SCA_NANDController::Attributes[] = { + { NULL } //Sentinel +}; + PyObject* SCA_NANDController::_getattr(const char *attr) { _getattr_up(SCA_IController); } diff --git a/source/gameengine/GameLogic/SCA_NORController.cpp b/source/gameengine/GameLogic/SCA_NORController.cpp index fa24be9ebce..1de6a641c3d 100644 --- a/source/gameengine/GameLogic/SCA_NORController.cpp +++ b/source/gameengine/GameLogic/SCA_NORController.cpp @@ -137,6 +137,10 @@ PyMethodDef SCA_NORController::Methods[] = { {NULL,NULL} //Sentinel }; +PyAttributeDef SCA_NORController::Attributes[] = { + { NULL } //Sentinel +}; + PyObject* SCA_NORController::_getattr(const char *attr) { _getattr_up(SCA_IController); } diff --git a/source/gameengine/GameLogic/SCA_ORController.cpp b/source/gameengine/GameLogic/SCA_ORController.cpp index 42a29e1959b..61fbc889d90 100644 --- a/source/gameengine/GameLogic/SCA_ORController.cpp +++ b/source/gameengine/GameLogic/SCA_ORController.cpp @@ -129,6 +129,11 @@ PyMethodDef SCA_ORController::Methods[] = { {NULL,NULL} //Sentinel }; +PyAttributeDef SCA_ORController::Attributes[] = { + { NULL } //Sentinel +}; + + PyObject* SCA_ORController::_getattr(const char *attr) { _getattr_up(SCA_IController); } diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index 92852ee03cb..c75e36acab2 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -264,6 +264,9 @@ PyMethodDef SCA_PythonController::Methods[] = { {NULL,NULL} //Sentinel }; +PyAttributeDef SCA_PythonController::Attributes[] = { + { NULL } //Sentinel +}; bool SCA_PythonController::Compile() { diff --git a/source/gameengine/GameLogic/SCA_XNORController.cpp b/source/gameengine/GameLogic/SCA_XNORController.cpp index b019aedc93d..b2734dd1b33 100644 --- a/source/gameengine/GameLogic/SCA_XNORController.cpp +++ b/source/gameengine/GameLogic/SCA_XNORController.cpp @@ -141,6 +141,10 @@ PyMethodDef SCA_XNORController::Methods[] = { {NULL,NULL} //Sentinel }; +PyAttributeDef SCA_XNORController::Attributes[] = { + { NULL } //Sentinel +}; + PyObject* SCA_XNORController::_getattr(const char *attr) { _getattr_up(SCA_IController); } diff --git a/source/gameengine/GameLogic/SCA_XORController.cpp b/source/gameengine/GameLogic/SCA_XORController.cpp index 11ffa19b8f1..662ef523d56 100644 --- a/source/gameengine/GameLogic/SCA_XORController.cpp +++ b/source/gameengine/GameLogic/SCA_XORController.cpp @@ -141,6 +141,10 @@ PyMethodDef SCA_XORController::Methods[] = { {NULL,NULL} //Sentinel }; +PyAttributeDef SCA_XORController::Attributes[] = { + { NULL } //Sentinel +}; + PyObject* SCA_XORController::_getattr(const char *attr) { _getattr_up(SCA_IController); } |