Animation.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef ANIMATION_H_
  2. #define ANIMATION_H_
  3. #include "Object.h"
  4. #include "AnimationChannel.h"
  5. namespace gameplay
  6. {
  7. class Animation : public Object
  8. {
  9. public:
  10. /**
  11. * Constructor.
  12. */
  13. Animation(void);
  14. /**
  15. * Destructor.
  16. */
  17. virtual ~Animation(void);
  18. virtual unsigned int getTypeId(void) const;
  19. virtual const char* getElementName(void) const;
  20. virtual void writeBinary(FILE* file);
  21. virtual void writeText(FILE* file);
  22. /**
  23. * Adds the given animation channel to this animation.
  24. *
  25. * @param animationChannel The animation channel to add.
  26. */
  27. void add(AnimationChannel* animationChannel);
  28. /**
  29. * Removes the given animation channel from this animation.
  30. *
  31. * @param animationChannel The animation channel to remove.
  32. */
  33. void remove(AnimationChannel* animationChannel);
  34. /**
  35. * Returns the number of animation channels contained in this animation.
  36. *
  37. * @return The number of animation channels.
  38. */
  39. unsigned int getAnimationChannelCount() const;
  40. /**
  41. * Returns the animation channel at the given index.
  42. *
  43. * @param index The index of the animation channel to get.
  44. *
  45. * @return The pointer to the animation channel or NULL if not found.
  46. */
  47. AnimationChannel* getAnimationChannel(unsigned int index) const;
  48. private:
  49. std::vector<AnimationChannel*> _channels;
  50. };
  51. }
  52. #endif