User:Bigbigrice

00001 /* 00002 * cocos2d for iPhone: 00003 * 00004  * Copyright (c) 2008-2010 Ricardo Quesada 00005 * 00006  * Permission is hereby granted, free of charge, to any person obtaining a copy 00007 * of this software and associated documentation files (the "Software"), to deal 00008 * in the Software without restriction, including without limitation the rights 00009 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 00010 * copies of the Software, and to permit persons to whom the Software is 00011  * furnished to do so, subject to the following conditions: 00012 * 00013  * The above copyright notice and this permission notice shall be included in 00014  * all copies or substantial portions of the Software. 00015 * 00016  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00017  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00018 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 00019 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 00020 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 00021 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 00022  * THE SOFTWARE. 00023 * 00024  */ 00025 00026 00027 #import "CCAction.h" 00028 00032 @interface CCActionInstant : CCFiniteTimeAction  00033 { 00034 } 00035 @end 00036 00039 @interface CCShow : CCActionInstant 00040 { 00041 } 00042 @end 00043 00046 @interface CCHide : CCActionInstant 00047 { 00048 } 00049 @end 00050 00053 @interface CCToggleVisibility : CCActionInstant 00054 { 00055 } 00056 @end 00057 00061 @interface CCFlipX : CCActionInstant 00062 { 00063        BOOL    flipX; 00064 } 00065 +(id) actionWithFlipX:(BOOL)x; 00066 -(id) initWithFlipX:(BOOL)x; 00067 @end 00068 00072 @interface CCFlipY : CCActionInstant 00073 { 00074        BOOL    flipY; 00075 } 00076 +(id) actionWithFlipY:(BOOL)y; 00077 -(id) initWithFlipY:(BOOL)y; 00078 @end 00079 00082 @interface CCPlace : CCActionInstant  00083 { 00084        CGPoint position; 00085 } 00087 +(id) actionWithPosition: (CGPoint) pos; 00089 -(id) initWithPosition: (CGPoint) pos; 00090 @end 00091 00094 @interface CCCallFunc : CCActionInstant  00095 { 00096        id targetCallback_; 00097        SEL selector_; 00098 } 00100 +(id) actionWithTarget: (id) t selector:(SEL) s; 00102 -(id) initWithTarget: (id) t selector:(SEL) s; 00104 -(void) execute; 00105 @end 00106 00110 @interface CCCallFuncN : CCCallFunc 00111 { 00112 } 00113 @end 00114 00115 typedef void (*CC_CALLBACK_ND)(id, SEL, id, void *); 00119 @interface CCCallFuncND : CCCallFuncN 00120 { 00121        void                    *data_; 00122        CC_CALLBACK_ND  callbackMethod_; 00123 } 00124 00126 @property (nonatomic,readwrite) CC_CALLBACK_ND callbackMethod; 00127 00129 +(id) actionWithTarget: (id) t selector:(SEL) s data:(void*)d; 00131 -(id) initWithTarget:(id) t selector:(SEL) s data:(void*) d; 00132 @end 00133 00138 @interface CCCallFuncO : CCCallFunc 00139 { 00140        id      object_; 00141 } 00143 +(id) actionWithTarget: (id) t selector:(SEL) s object:(id)object; 00145 -(id) initWithTarget:(id) t selector:(SEL) s object:(id)object; 00146 00147 @end 00148 00149 #pragma mark Blocks Support 00150 00151 #if NS_BLOCKS_AVAILABLE 00152 00155 @interface CCCallBlock : CCActionInstant 00156 { 00157        void (^block_); 00158 } 00159 00163 +(id) actionWithBlock:(void(^))block; 00164 00168 -(id) initWithBlock:(void(^))block; 00169 00171 -(void) execute; 00172 @end 00173 00174 @class CCNode; 00175 00178 @interface CCCallBlockN : CCActionInstant 00179 { 00180        void (^block_)(CCNode *); 00181 } 00182 00186 +(id) actionWithBlock:(void(^)(CCNode *node))block; 00187 00191 -(id) initWithBlock:(void(^)(CCNode *node))block; 00192 00194 -(void) execute; 00195 @end 00196 00197 #endif
 * 1) REDIRECT []