29 #ifndef THOR_ANIMATIONMAP_HPP
30 #define THOR_ANIMATIONMAP_HPP
34 #include <SFML/System/Time.hpp>
47 template <
class Animated>
54 typedef std::function<void(Animated&, float)> AnimationFunction;
56 TimedAnimation(AnimationFunction animation, sf::Time duration)
57 : function(std::move(animation))
62 AnimationFunction
function;
72 template <
class Animated,
typename Id>
81 template <
class Animated,
typename Id>
87 typedef detail::TimedAnimation<Animated> TimedAnimation;
107 void addAnimation(Id
id, std::function<
void(Animated&,
float)> animation, sf::Time duration);
113 const TimedAnimation& getAnimation(
const Id&
id)
const;
119 std::map<Id, TimedAnimation> mAnimationMap;
124 friend class Animator<Animated, Id>;
131 #include <Thor/Animations/Detail/AnimationMap.inl>
132 #endif // THOR_ANIMATIONMAP_HPP
Class that stores multiple animations.
Definition: AnimationMap.hpp:82
Definition: AnimationMap.hpp:42
Class to animate objects.
Definition: AnimationMap.hpp:73
Configuration header of the library.
void addAnimation(Id id, std::function< void(Animated &, float)> animation, sf::Time duration)
Registers an animation with a given identifier.
AnimationMap()
Default constructor.