#pragma once #include #include #include "Animation.hpp" struct Animation; class AnimatedSprite: public sf::Sprite { public: AnimatedSprite(); virtual ~AnimatedSprite(); void addAnimation(std::string filename, unsigned duration, std::string name, bool loop, unsigned width, unsigned height); void setAnimation(std::string name, bool force = false); void setAnimationSpeed(float speed); virtual void animate(); protected: void setDir(int dir); Animation* m_current_anim; sf::Clock m_clock; private: float m_speed; std::unordered_map m_anim; };