#ifndef ANIMATION_SYSTEM_H_CCCC7CB8 #define ANIMATION_SYSTEM_H_CCCC7CB8 #include #include "direction.h" #include "system.h" #include "timer.h" class Game; class AnimationSystem : public System { public: static constexpr SystemKey Key = SystemKey::Animation; AnimationSystem(Game& game) : game_(game) {} void tick(double dt) override; // Advances animation by a frame. Only to be used on manual animations. void advanceAnimation(int spriteId); void initSprite(int spriteId, std::string_view filename); void setSpriteDirection(int spriteId, Direction dir); void setSpriteAnimation(int spriteId, std::string_view name); private: void updateAnimation(int spriteId); Game& game_; Timer animTimer_ {1000/5};//30fps * 1000 t/s;; }; #endif /* end of include guard: ANIMATION_SYSTEM_H_CCCC7CB8 */