#pragma once

#include <unordered_map>
#include <SFML/Graphics.hpp>
#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);
	void setAnimation(std::string name);
	void setAnimationSpeed(float speed);
	virtual void animate();
protected:
	Animation* m_current_anim;
	sf::Clock m_clock;
private:
	float m_speed;
	std::unordered_map<std::string, Animation> m_anim;
};
