@@ -67,26 +67,30 @@ class CCX_DLL CCAction : public NSObject
67
67
// ! * 0.5 means that the action is in the middle
68
68
// ! * 1 means that the action is over
69
69
virtual void update (ccTime time);
70
-
70
+
71
+ inline CCNode* getTarget (void ) { return m_pTarget; }
71
72
/* * The "target". The action will modify the target properties.
72
- The target will be set with the 'startWithTarget' method.
73
- When the 'stop' method is called, target will be set to nil.
74
- The target is 'assigned', it is not 'retained'.
75
- */
76
- CCNode* getTarget (void ) { return m_pTarget; }
77
-
73
+ The target will be set with the 'startWithTarget' method.
74
+ When the 'stop' method is called, target will be set to nil.
75
+ The target is 'assigned', it is not 'retained'.
76
+ */
77
+ inline void setTarget (CCNode *pTarget) { m_pTarget = pTarget; }
78
+
79
+ inline CCNode* getOriginalTarget (void ) { return m_pOriginalTarget; }
78
80
/* * The original target, since target can be nil.
79
- Is the target that were used to run the action. Unless you are doing something complex, like ActionManager, you should NOT call this method.
80
- @since v0.8.2
81
+ Is the target that were used to run the action. Unless you are doing something complex, like ActionManager, you should NOT call this method.
82
+ The target is 'assigned', it is not 'retained'.
83
+ @since v0.8.2
81
84
*/
82
- CCNode* getOriginalTarget ( void ) { return m_pOriginalTarget; }
85
+ inline void setOriginalTarget (CCNode *pOriginalTarget ) { m_pOriginalTarget = pOriginalTarget ; }
83
86
84
- // The action tag. An identifier of the action
85
- int getTag (void ) { return m_nTag; }
86
- void setTag (int nTag) { m_nTag = nTag; }
87
+ /* * The action tag. An identifier of the action */
88
+ inline int getTag (void ) { return m_nTag; }
89
+ // ! The tag is 'assigned', it is not 'retained'.
90
+ inline void setTag (int nTag) { m_nTag = nTag; }
87
91
88
92
public:
89
- // Allocates and initializes the action
93
+ /* * Allocates and initializes the action */
90
94
static CCAction* action ();
91
95
92
96
protected:
@@ -107,10 +111,10 @@ class CCX_DLL CCFiniteTimeAction : public CCAction
107
111
CCFiniteTimeAction (){}
108
112
virtual ~CCFiniteTimeAction (){}
109
113
// ! duration in seconds of the action
110
- ccTime getDuration (void ) { return m_fDuration; }
111
- void setDuration (ccTime duration) { m_fDuration = duration; }
114
+ inline ccTime getDuration (void ) { return m_fDuration; }
115
+ inline void setDuration (ccTime duration) { m_fDuration = duration; }
112
116
113
- // returns a reversed action
117
+ /* * returns a reversed action */
114
118
virtual CCFiniteTimeAction* reverse (void );
115
119
protected:
116
120
// ! duration in seconds
@@ -131,13 +135,12 @@ class CCX_DLL CCSpeed : public CCAction
131
135
CCSpeed (){}
132
136
virtual ~CCSpeed (void );
133
137
134
- // alter the speed of the inner function in runtime
135
- float getSpeed ( void ) { return m_fSpeed; }
136
- void setSpeed (float fSpeed ) { m_fSpeed = fSpeed ; }
138
+ inline float getSpeed ( void ) { return m_fSpeed; }
139
+ /* * alter the speed of the inner function in runtime */
140
+ inline void setSpeed (float fSpeed ) { m_fSpeed = fSpeed ; }
137
141
138
- // initializes the action
142
+ /* * initializes the action */
139
143
bool initWithAction (CCIntervalAction *pAction, float fRate );
140
- /* CCSpeed* initWithAction(CCRepeatForever *pAction, float fRate);*/
141
144
142
145
virtual NSObject* copyWithZone (NSZone *pZone);
143
146
virtual void startWithTarget (CCNode* pTarget);
@@ -147,20 +150,18 @@ class CCX_DLL CCSpeed : public CCAction
147
150
virtual CCIntervalAction* reverse (void );
148
151
149
152
public:
150
- // creates the action
153
+ /* * creates the action */
151
154
static CCSpeed* actionWithAction (CCIntervalAction *pAction, float fRate );
152
- /* static CCSpeed* actionWithAction(CCRepeatForever *pAction, float fRate);*/
153
155
154
156
protected:
155
157
float m_fSpeed;
156
158
CCIntervalAction *m_pOther;
157
- /* CCRepeatForever *m_pRepeat;*/
158
159
};
159
160
160
161
/* * CCFollow is an action that "follows" a node.
161
162
162
163
Eg:
163
- [ layer runAction: [ CCFollow actionWithTarget: hero]] ;
164
+ layer-> runAction( CCFollow::actionWithTarget( hero)) ;
164
165
165
166
Instead of using CCCamera as a "follower", use this action instead.
166
167
@since v0.99.2
@@ -174,15 +175,15 @@ class CCX_DLL CCFollow : public CCAction
174
175
public:
175
176
CCFollow (){}
176
177
virtual ~CCFollow (void );
178
+
179
+ inline bool isBoundarySet (void ) { return m_bBoundarySet; }
180
+ /* * alter behavior - turn on/off boundary */
181
+ inline void setBoudarySet (bool bValue) { m_bBoundarySet = bValue; }
177
182
178
- // alter behavior - turn on/off boundary
179
- bool isBoundarySet (void ) { return m_bBoundarySet; }
180
- void setBoudarySet (bool bValue) { m_bBoundarySet = bValue; }
181
-
182
- // initializes the action
183
+ /* * initializes the action */
183
184
bool initWithTarget (CCNode *pFollowedNode);
184
185
185
- // initializes the action with a set boundary
186
+ /* * initializes the action with a set boundary */
186
187
bool initWithTarget (CCNode *pFollowedNode, CGRect rect);
187
188
188
189
virtual NSObject* copyWithZone (NSZone *pZone);
@@ -191,10 +192,10 @@ class CCX_DLL CCFollow : public CCAction
191
192
virtual void stop (void );
192
193
193
194
public:
194
- // creates the action with no boundary set
195
+ /* * creates the action with no boundary set */
195
196
static CCFollow* actionWithTarget (CCNode *pFollowedNode);
196
197
197
- // creates the action with a set boundary
198
+ /* * creates the action with a set boundary */
198
199
static CCFollow* actionWithTarget (CCNode *pFollowedNode, CGRect rect);
199
200
200
201
protected:
0 commit comments