#ifndef _fencer_animation_sprite_h
#define _fencer_animation_sprite_h

#include "sprite.h"
#include "spritesheet.h"

typedef enum AnimationSpriteLoopMode {
	LoopMode_Stop,
	LoopMode_Hide,
	LoopMode_Loop,
	LoopMode_PingPong,
} AnimationSpriteLoopMode;

typedef struct AnimationSprite AnimationSprite;

extern AnimationSprite* animation_sprite_new(Sprite* target_sprite, Spritesheet* sheet, float framerate, AnimationSpriteLoopMode loop_mode);
extern void animation_sprite_destroy(AnimationSprite* self);

extern void animation_sprite_play_from(AnimationSprite* self, float normalized_time);
extern void animation_sprite_draw(AnimationSprite* self, Transform* transform);

extern float animation_sprite_get_length(AnimationSprite* self);
extern void animation_sprite_set_framerate(AnimationSprite* self, float framerate);
extern float animation_sprite_get_framerate(const AnimationSprite* self);
extern Sprite* animation_sprite_get_sprite(AnimationSprite* self);
extern float animation_sprite_get_time(AnimationSprite* self);
extern float animation_sprite_get_time_normalized(AnimationSprite* self);

#endif // !_fencer_animation_sprite_h
