#ifndef GRAPHICS_ANIMATION_H #define GRAPHICS_ANIMATION_H #include namespace Graphics{ class Animation{ protected: int i_; int count_; int row_; int lastTime_; int switchTime_; unsigned int w_, h_; sf::IntRect rect_; sf::Texture texture_; bool ticked(int deltaTime); public: Animation(); ~Animation(); Animation(const sf::Texture& texture, int count, int switchTime, int height, int width, int row); virtual sf::IntRect& next(int deltaTime); virtual void reset(); virtual bool finished(); }; class OneShotAnimation : public Animation { public: OneShotAnimation(); OneShotAnimation(const sf::Texture& texture, int count, int switchTime, int height, int width, int row); sf::IntRect& next(int deltaTime) override; bool finished() override; }; class BouncingAnimation : public Animation{ private: bool up_; public: BouncingAnimation(); BouncingAnimation(const sf::Texture& texture, int count, int switchTime, int height, int width, int row); ~BouncingAnimation(); sf::IntRect& next(int deltaTime) override; }; } #endif // GRAPHICS_ANIMATION_H