29 #ifndef THOR_ANIMATOR_HPP
30 #define THOR_ANIMATOR_HPP
36 #include <Aurora/Tools/Optional.hpp>
37 #include <Aurora/Tools/Algorithms.hpp>
39 #include <SFML/System/Time.hpp>
66 template <
class Animated,
typename Id>
96 AURORA_IMPL_DEF(detail::PlayingQueue<Id>)
play();
107 AURORA_IMPL_DEF(detail::PlayingQueue<Id>)
queue();
128 void animate(Animated& animated) const;
134 typedef detail::TimedAnimation<Animated> TimedAnimation;
141 std::queue<detail::PlaybackScheme<Id>> mQueuedIds;
142 std::vector<const TimedAnimation*> mPlayingAnimations;
143 sf::Time mProgressedTime;
150 #include <Thor/Animations/Detail/Animator.inl>
151 #endif // THOR_ANIMATOR_HPP
Animator(const AnimationMap< Animated, Id > &animations)
Construct from animation map.
void stop()
Stops all playing and queued animations.
Class that stores multiple animations.
Definition: AnimationMap.hpp:82
Definition: AnimationMap.hpp:42
Configuration header of the library.
std::function< void(Animated &, float)> AnimationFunction
Functor to animate the objects.
Definition: Animator.hpp:76
void animate(Animated &animated) const
Applies the stored animations to an object.
void update(sf::Time dt)
Updates the animator's progress. You should call this method each frame.
Namespace thor::Playback.
Definition: BigSprite.hpp:41
Class template thor::AnimationMap.
ImplementationDefined play()
Plays one or more animations, discarding the current queue.
ImplementationDefined queue()
Plays one or more animations, appending to current queue.