#ifndef ANIMATION_HPP_
#define ANIMATION_HPP_

#include <vector>
#include <memory>
#include <string>
#include <atomic>

#include <Material/Material.hpp>

/**
 * @brief Represents an animated sprite.
 */
class Animation
{
private:
    const char* name;
    uint32_t frameDuration;

    std::vector<std::shared_ptr<Material>> frames;

public:
    /**
     * @brief Construct an animation.
     */
    Animation(const char *name, uint32_t frameDuration);

    /**
     * @brief Perform the loading of this animation.
     */
    void load(std::atomic<unsigned int> &tasksDone);

    /**
     * @brief Return the for the current frame.
     */
    Material& getCurrentFrame();

    #define DECL_ANIMATION(name, fps) static Animation name
    #include <Animation/AnimationList.hpp>
};

#endif