VisualTargetTrans.h
Go to the documentation of this file.00001
00002 #ifndef INCLUDED_VisualTargetTrans_h_
00003 #define INCLUDED_VisualTargetTrans_h_
00004
00005 #include "Events/EventRouter.h"
00006 #include "Shared/debuget.h"
00007 #include "Shared/WorldState.h"
00008
00009
00010 class VisualTargetTrans : public Transition {
00011 public:
00012
00013 VisualTargetTrans(StateNode* destination, unsigned int source_id)
00014 : Transition(destination), sid(source_id), count(0) {}
00015
00016
00017 VisualTargetTrans(const std::string& name, StateNode* destination, unsigned int source_id)
00018 : Transition(name,destination), sid(source_id), count(0) {}
00019
00020
00021 virtual void postStart() {
00022 Transition::postStart();
00023 count=0;
00024 erouter->addListener(this,EventBase::visObjEGID,sid);
00025 }
00026
00027
00028 virtual void doEvent() {
00029
00030
00031 if(event->getTypeID()==EventBase::deactivateETID)
00032 count=0;
00033 else
00034 count++;
00035 if(count>5)
00036 fire(*event);
00037
00038
00039 }
00040
00041 protected:
00042
00043 unsigned int sid;
00044
00045 unsigned int count;
00046 };
00047
00048
00049
00050
00051
00052
00053 #endif