#ifndef ANIMATION_SYSTEM_H_CCCC7CB8 #define ANIMATION_SYSTEM_H_CCCC7CB8 #include #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; 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_; std::vector animTimers_ = {{1000/5}, {1000/60}};//30fps * 1000 t/s;; Timer bobbingTimer_ {1000/7}; Timer fadingTimer_ {1000/60}; }; #endif /* end of include guard: ANIMATION_SYSTEM_H_CCCC7CB8 */