diff options
author | Joshua Leung <aligorith@gmail.com> | 2008-02-06 00:09:38 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2008-02-06 00:09:38 +0300 |
commit | 33f3f852353a12a58bd2ed7c87b01754e4f4a130 (patch) | |
tree | b10d51be82ea336249ff6f6c43ca18970061405c /source/gameengine/GameLogic | |
parent | 4d58ff50cff6c63614faaa093b70b6594088e91a (diff) |
Reverting some other changes zaghaghi made
Diffstat (limited to 'source/gameengine/GameLogic')
-rw-r--r-- | source/gameengine/GameLogic/SCA_ISensor.cpp | 14 | ||||
-rw-r--r-- | source/gameengine/GameLogic/SCA_ISensor.h | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/source/gameengine/GameLogic/SCA_ISensor.cpp b/source/gameengine/GameLogic/SCA_ISensor.cpp index 43dd6bef83e..cca303c6266 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.cpp +++ b/source/gameengine/GameLogic/SCA_ISensor.cpp @@ -160,6 +160,8 @@ PyMethodDef SCA_ISensor::Methods[] = { METH_VARARGS, GetInvert_doc}, {"setInvert", (PyCFunction) SCA_ISensor::sPySetInvert, METH_VARARGS, SetInvert_doc}, + {"evaluate", (PyCFunction) SCA_ISensor::sPyEvaluate, + METH_VARARGS, Evaluate_doc}, {NULL,NULL} //Sentinel }; @@ -331,4 +333,16 @@ PyObject* SCA_ISensor::PySetUseNegPulseMode(PyObject* self, PyObject* args, PyOb Py_Return; } +char SCA_ISensor::Evaluate_doc[] = +"evaluate()\n" +"\tRe-evaluate the sensor so that isPositive() and other methods are up to date\n" +"\twith current game conditions. BGE does it automatically on each frame so it's\n" +"\tnot usually needed.\n" +"\tReturns True or False if the sensor evaluates positively or negatively\n"; +PyObject* SCA_ISensor::PyEvaluate(PyObject* self, PyObject* args, PyObject* kwds) +{ + return BoolToPyArg(Evaluate(NULL)); +} + + /* eof */ diff --git a/source/gameengine/GameLogic/SCA_ISensor.h b/source/gameengine/GameLogic/SCA_ISensor.h index fb2dca97d06..469ea3995b8 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.h +++ b/source/gameengine/GameLogic/SCA_ISensor.h @@ -122,6 +122,7 @@ public: KX_PYMETHOD_DOC(SCA_ISensor,SetUseNegPulseMode); KX_PYMETHOD_DOC(SCA_ISensor,GetInvert); KX_PYMETHOD_DOC(SCA_ISensor,SetInvert); + KX_PYMETHOD_DOC(SCA_ISensor,Evaluate); }; |