00001 00006 00007 #ifndef __KX_ALWAYSSENSOR 00008 #define __KX_ALWAYSSENSOR 00009 #include "SCA_ISensor.h" 00010 00011 00012 class SCA_AlwaysSensor : public SCA_ISensor 00013 { 00014 Py_Header; 00015 bool m_alwaysresult; 00016 public: 00017 SCA_AlwaysSensor(class SCA_EventManager* eventmgr, 00018 SCA_IObject* gameobj, 00019 PyTypeObject* T =&Type); 00020 virtual ~SCA_AlwaysSensor() {/* intentionally empty */}; 00021 virtual CValue* GetReplica() { 00022 CValue* replica = new SCA_AlwaysSensor(*this);//m_float,GetName()); 00023 // this will copy properties and so on... 00024 CValue::AddDataToReplica(replica); 00025 return replica; 00026 }; 00027 00028 00029 virtual bool Evaluate(CValue* event); 00030 virtual bool IsPositiveTrigger() { 00031 return (m_invert ? false : true); 00032 }; 00033 00034 00035 00036 00037 /* --------------------------------------------------------------------- */ 00038 /* Python interface ---------------------------------------------------- */ 00039 /* --------------------------------------------------------------------- */ 00040 00041 virtual PyObject* _getattr(char *attr); 00042 00043 00044 }; 00045 00046 #endif //__KX_ALWAYSSENSOR