/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. #import <Foundation/Foundation.h>
  27. #import "SynthesizeSingleton.h"
  28. #import "OALAction.h"
  29. #import "ObjectALConfig.h"
  30. /* This object is only available if OBJECTAL_USE_COCOS2D_ACTIONS is enabled in ObjectALConfig.h.
  31. */
  32. #if !OBJECTAL_USE_COCOS2D_ACTIONS
  33. #pragma mark OALActionManager
  34. /**
  35. * Manages all ObjectAL actions.
  36. */
  37. @interface OALActionManager : NSObject
  38. {
  39. /** All targets that have actions running on them (id). */
  40. NSMutableArray* targets;
  41. /** Parallel array to "targets", maintaining a list of all actions per target (NSMutableArray*) */
  42. NSMutableArray* targetActions;
  43. /** All actions that are to be added on the next pass (OALAction*) */
  44. NSMutableArray* actionsToAdd;
  45. /** All actions that are to be removed on the next pass (OALAction*) */
  46. NSMutableArray* actionsToRemove;
  47. /** The timer which we use to update the actions. */
  48. NSTimer* stepTimer;
  49. /** The last time that was recorded. */
  50. uint64_t lastTimestamp;
  51. }
  52. #pragma mark Object Management
  53. /** Singleton implementation providing "sharedInstance" and "purgeSharedInstance" methods.
  54. *
  55. * <b>- (OALAudioSupport*) sharedInstance</b>: Get the shared singleton instance. <br>
  56. * <b>- (void) purgeSharedInstance</b>: Purge (deallocate) the shared instance.
  57. */
  58. SYNTHESIZE_SINGLETON_FOR_CLASS_HEADER(OALActionManager);
  59. #pragma mark Action Management
  60. /** Stops ALL running actions on ALL targets.
  61. */
  62. - (void) stopAllActions;
  63. #pragma mark Internal Use
  64. /** (INTERNAL USE) Used by OALAction to announce that it is starting.
  65. *
  66. * @param action The action that is starting.
  67. */
  68. - (void) notifyActionStarted:(OALAction*) action;
  69. /** (INTERNAL USE) Used by OALAction to announce that it is stopping.
  70. *
  71. * @param action The action that is stopping.
  72. */
  73. - (void) notifyActionStopped:(OALAction*) action;
  74. @end
  75. #endif /* OBJECTAL_USE_COCOS2D_ACTIONS */