#include "ccTypes.h" #include "CCObject.h" #include "CCZone.h" #include "CCNode.h" namespace cocos2d { enum { kCCActionTagInvalid = -1, }; class CCAction : public CCObject { CCAction(void); char * description(); CCObject* copyWithZone(CCZone *pZone); bool isDone(void); void startWithTarget(CCNode *pTarget); void stop(void); void step(ccTime dt); void update(ccTime time); CCNode* getTarget(void); void setTarget(CCNode *pTarget); CCNode* getOriginalTarget(void); void setOriginalTarget(CCNode *pOriginalTarget); int getTag(void); void setTag(int nTag); static CCAction* action(); }; class CCFiniteTimeAction : public CCAction { CCFiniteTimeAction(); ~CCFiniteTimeAction(){} //! get duration in seconds of the action ccTime getDuration(void); //! set duration in seconds of the action void setDuration(ccTime duration); virtual CCFiniteTimeAction* reverse(void); }; class CCActionInterval; class CCRepeatForever; class CCSpeed : public CCAction { public: CCSpeed(); virtual ~CCSpeed(void); float getSpeed(void); /** alter the speed of the inner function in runtime */ void setSpeed(float fSpeed); /** initializes the action */ bool initWithAction(CCActionInterval *pAction, float fRate); CCObject* copyWithZone(CCZone *pZone); void startWithTarget(CCNode* pTarget); void stop(); void step(ccTime dt); bool isDone(void); CCActionInterval* reverse(void); static CCSpeed* actionWithAction(CCActionInterval *pAction, float fRate); }; class CCFollow : public CCAction { public: CCFollow(); bool isBoundarySet(void); void setBoudarySet(bool bValue); bool initWithTarget(CCNode *pFollowedNode); bool initWithTarget(CCNode *pFollowedNode, CCRect rect); virtual CCObject* copyWithZone(CCZone *pZone); virtual void step(ccTime dt); virtual bool isDone(void); virtual void stop(void); static CCFollow* actionWithTarget(CCNode *pFollowedNode); static CCFollow* actionWithTarget(CCNode *pFollowedNode, CCRect rect); }; }//namespace cocos2d