00001
00006
00007 #include "SCA_AlwaysSensor.h"
00008 #include "SCA_LogicManager.h"
00009 #include "SCA_EventManager.h"
00010
00011
00012
00013
00014
00015 SCA_AlwaysSensor::SCA_AlwaysSensor(class SCA_EventManager* eventmgr,
00016 SCA_IObject* gameobj,
00017 PyTypeObject* T)
00018 : SCA_ISensor(gameobj,eventmgr, T)
00019 {
00020
00021 m_alwaysresult = true;
00022 }
00023
00024 bool SCA_AlwaysSensor::Evaluate(CValue* event)
00025 {
00026
00027
00028
00029
00030
00031
00032 bool result = m_alwaysresult;
00033 m_alwaysresult = false;
00034 return result;
00035 }
00036
00037
00038
00039
00040
00041
00042 PyTypeObject SCA_AlwaysSensor::Type = {
00043 PyObject_HEAD_INIT(&PyType_Type)
00044 0,
00045 "SCA_AlwaysSensor",
00046 sizeof(SCA_AlwaysSensor),
00047 0,
00048 PyDestructor,
00049 0,
00050 __getattr,
00051 __setattr,
00052 0,
00053 __repr,
00054 0,
00055 0,
00056 0,
00057 0,
00058 0
00059 };
00060
00061 PyParentObject SCA_AlwaysSensor::Parents[] = {
00062 &SCA_AlwaysSensor::Type,
00063 &SCA_ISensor::Type,
00064 &SCA_ILogicBrick::Type,
00065 &CValue::Type,
00066 NULL
00067 };
00068
00069 PyMethodDef SCA_AlwaysSensor::Methods[] = {
00070 {NULL,NULL}
00071 };
00072
00073 PyObject* SCA_AlwaysSensor::_getattr(char* attr) {
00074 _getattr_up(SCA_ISensor);
00075 }
00076
00077