00001 #ifndef __KX_IACTUATOR 00002 #define __KX_IACTUATOR 00003 00004 #include "SCA_ILogicBrick.h" 00005 00006 #include <vector> 00007 using namespace std; 00008 00009 class SCA_IActuator : public SCA_ILogicBrick 00010 { 00011 protected: 00012 vector<CValue*> m_events; 00013 void RemoveAllEvents() { 00014 // remove event queue! 00015 for (vector<CValue*>::iterator i=m_events.begin(); !(i==m_events.end());i++) 00016 { 00017 (*i)->Release(); 00018 } 00019 m_events.clear(); 00020 } 00021 public: 00022 SCA_IActuator(SCA_IObject* gameobj,PyTypeObject* T =&Type) 00023 :SCA_ILogicBrick(gameobj,T) { 00024 //SetDrawColor(0xff0000ff); 00025 }; 00026 virtual ~SCA_IActuator() { 00027 RemoveAllEvents(); 00028 }; 00029 virtual bool Update(double curtime,double deltatime); 00030 virtual void AddEvent(CValue* event) 00031 { 00032 m_events.push_back(event); 00033 } 00034 virtual void ProcessReplica() 00035 { 00036 m_events.clear(); 00037 } 00038 bool IsNegativeEvent(); 00039 }; 00040 #endif //__KX_IACTUATOR