diff options
Diffstat (limited to 'src/simpleanimation.h')
-rw-r--r-- | src/simpleanimation.h | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/simpleanimation.h b/src/simpleanimation.h index a56c31da..14793c2f 100644 --- a/src/simpleanimation.h +++ b/src/simpleanimation.h @@ -26,7 +26,10 @@ #include "resources/animation.h" +#include "utils/xml.h" + class Frame; +class Graphics; /** * This class is a leightweight alternative to the AnimatedSprite class. @@ -35,6 +38,10 @@ class Frame; class SimpleAnimation { public: + + /** + * Creates a simple animation with an already created animation + */ SimpleAnimation(Animation *animation): mAnimation(animation), mAnimationTime(0), @@ -42,6 +49,11 @@ class SimpleAnimation mCurrentFrame(mAnimation->getFrame(0)) {}; + /** + * Creates a simple animation that creates its animation from XML Data + */ + SimpleAnimation(xmlNodePtr animationNode); + ~SimpleAnimation(); void update(unsigned int timePassed); @@ -49,17 +61,10 @@ class SimpleAnimation Image *getCurrentImage() const; private: - /** The hosted animation. */ - Animation *mAnimation; - - /** Time in game ticks the current frame is shown. */ - unsigned int mAnimationTime; - - /** Index of current animation frame. */ - unsigned int mAnimationPhase; - - /** Current animation frame. */ - Frame *mCurrentFrame; + Animation *mAnimation; /**< The hosted animation */ + unsigned int mAnimationTime; /**< Time in game ticks the current frame is shown*/ + unsigned int mAnimationPhase; /**< Index of current animation phase*/ + Frame *mCurrentFrame; /**< Current animation phase */ }; #endif |