#ifndef SIGN_H_B0491849
#define SIGN_H_B0491849

#include <string>
#include <list>
#include <SDL_ttf.h>
#include "interpolation.h"
#include "timer.h"

class Game;

enum class SignInstructionState {
  Hidden,
  FadingIn,
  Visible,
  FadingOut
};

struct SignLine {
  std::string text;
  bool pause = false;
  int charsRevealed = 0;
};

class Sign {
public:

  explicit Sign(TTF_Font* font) : font_(font) {}

  void displayMessage(std::string text);

  void update(size_t dt, Game& game);

  SignInstructionState signDisplayState = SignInstructionState::Hidden;
  Interpolation signDisplayFade;
  std::list<SignLine> lines;
  std::list<SignLine> linesToShow;
  bool showNextArrow = false;
  int nextArrowBobPos = 0;

private:

  TTF_Font* font_;
  Timer textAdvTimer_ { 15 };
  bool nextArrowBobDown_ = true;
  Timer nextArrowBobTimer_ { 125 };
};

#endif /* end of include guard: SIGN_H_B0491849 */