PageRenderTime 23ms CodeModel.GetById 10ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/libs/ObjectAL/Actions/OALActionManager.h

http://github.com/kstenerud/ObjectAL-for-iPhone
C Header | 97 lines | 24 code | 22 blank | 51 comment | 0 complexity | 1ec4db131fb0b33e0cf1b39093f4b9ae MD5 | raw file
 1//
 2//  OALActionManager.h
 3//  ObjectAL
 4//
 5//  Created by Karl Stenerud on 10-09-18.
 6//
 7// Copyright 2009 Karl Stenerud
 8//
 9// Licensed under the Apache License, Version 2.0 (the "License");
10// you may not use this file except in compliance with the License.
11// You may obtain a copy of the License at
12//
13// http://www.apache.org/licenses/LICENSE-2.0
14//
15// Unless required by applicable law or agreed to in writing, software
16// distributed under the License is distributed on an "AS IS" BASIS,
17// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18// See the License for the specific language governing permissions and
19// limitations under the License.
20//
21// Note: You are NOT required to make the license available from within your
22// iOS application. Including it in your project is sufficient.
23//
24// Attribution is not required, but appreciated :)
25//
26
27#import <Foundation/Foundation.h>
28#import "SynthesizeSingleton.h"
29#import "OALAction.h"
30#import "ObjectALConfig.h"
31
32/* This object is only available if OBJECTAL_USE_COCOS2D_ACTIONS is enabled in ObjectALConfig.h.
33 */
34#if !OBJECTAL_USE_COCOS2D_ACTIONS
35
36
37#pragma mark OALActionManager
38
39/**
40 * Manages all ObjectAL actions.
41 */
42@interface OALActionManager : NSObject
43{
44	/** All targets that have actions running on them (id). */
45	NSMutableArray* targets;
46	
47	/** Parallel array to "targets", maintaining a list of all actions per target (NSMutableArray*) */
48	NSMutableArray* targetActions;
49	
50	/** All actions that are to be added on the next pass (OALAction*) */
51	NSMutableArray* actionsToAdd;
52	
53	/** All actions that are to be removed on the next pass (OALAction*) */
54	NSMutableArray* actionsToRemove;
55	
56	/** The timer which we use to update the actions. */
57	NSTimer* stepTimer;
58	
59	/** The last time that was recorded. */
60	uint64_t lastTimestamp;
61}
62
63
64#pragma mark Object Management
65
66/** Singleton implementation providing "sharedInstance" and "purgeSharedInstance" methods.
67 *
68 * <b>- (OALAudioSupport*) sharedInstance</b>: Get the shared singleton instance. <br>
69 * <b>- (void) purgeSharedInstance</b>: Purge (deallocate) the shared instance.
70 */
71SYNTHESIZE_SINGLETON_FOR_CLASS_HEADER(OALActionManager);
72
73
74#pragma mark Action Management
75
76/** Stops ALL running actions on ALL targets.
77 */
78- (void) stopAllActions;
79
80
81#pragma mark Internal Use
82
83/** (INTERNAL USE) Used by OALAction to announce that it is starting.
84 *
85 * @param action The action that is starting.
86 */
87- (void) notifyActionStarted:(OALAction*) action;
88
89/** (INTERNAL USE) Used by OALAction to announce that it is stopping.
90 *
91 * @param action The action that is stopping.
92 */
93- (void) notifyActionStopped:(OALAction*) action;
94
95@end
96
97#endif /* OBJECTAL_USE_COCOS2D_ACTIONS */