/Classes/TargetedAction.h

http://github.com/kstenerud/ObjectAL-for-iPhone · C Header · 27 lines · 10 code · 5 blank · 12 comment · 0 complexity · bf05021330767f33d2b3ab006ce339fe MD5 · raw file

  1. //
  2. // TargetedAction.h
  3. // MouseMadness
  4. //
  5. // Created by Karl Stenerud on 09-12-24.
  6. //
  7. #import "cocos2d.h"
  8. /** Overrides the target of an action so that it always runs on the target
  9. * specified at action creation rather than the one specified by runAction.
  10. */
  11. @interface TargetedAction : CCIntervalAction <NSCopying>
  12. {
  13. id forcedTarget;
  14. CCFiniteTimeAction* action;
  15. }
  16. /** This is the target that the action will be forced to run with */
  17. @property(readwrite,retain) id forcedTarget;
  18. /** Create an action with the specified action and forced target */
  19. + (id) actionWithTarget:(id) target action:(CCFiniteTimeAction*) action;
  20. /** Init an action with the specified action and forced target */
  21. - (id) initWithTarget:(id) target action:(CCFiniteTimeAction*) action;
  22. @end