#ifndef INCLUDE_ANIMATOR_H #define INCLUDE_ANIMATOR_H #include #include #include "Rect.h" namespace WalrusRPG { struct Frame { unsigned frame; unsigned duration; // 1f = 1s }; struct Animation { tinystl::vector stripe; bool looping; }; class Animator { public: tinystl::unordered_map animations; protected: unsigned elapsed_time; public: Animator(); void add_animation(int index, Animation anim); void update(unsigned dt); unsigned get_animation_frame(unsigned id); }; } #endif