#ifndef ANIMATEDSTATE_H
#define ANIMATEDSTATE_H

#include <stdint.h>

#include <string>
using namespace std;

#define ANIMATION_STATUS_STOP 0
#define ANIMATION_STATUS_PAUSE 1
#define ANIMATION_STATUS_PLAY 2

class AnimatedState
{
 public:
  AnimatedState();
  ~AnimatedState();

  uint8_t getAnimationStatus();
  uint8_t getPreviousAnimationStatus();
  void play();
  void pause();
  void stop();
  void randomizedStop(int);

  void clear();

  void setAnimation (const string & name);
  const string & getAnimation ();

  void setDoNotPlaySoundUntilThisTime(uint32_t);
  uint32_t getDoNotPlaySoundUntilThisTime();

  uint32_t getTotalRunningTime();
  void setTotalRunningTime(uint32_t);
  void addToTotalRunningTime(uint32_t);

  uint32_t getLastTimeAnimated();
  void setLastTimeAnimated(uint32_t);

 private:
  uint32_t totalRunningTime;
  uint32_t lastTimeAnimated;

  uint8_t previousAnimationStatus;
  uint8_t currentAnimationStatus;

  string animToPlay;

  uint32_t doNotPlaySoundUntilThisTime;
};

#endif
