#pragma once

#include <imgui.h>

#include "../../entity.hpp"
#include "../../render/canvas.hpp"

#include "../../resources.hpp"

namespace game::state::play
{
  class Text
  {
    int index{};
    int updateDelay{};
    int baseDelay{};
    int currentDelay{};
    bool isFinished{};
    bool isTerminal{};
    bool isStartEffectsApplied{};
    bool isBlipQueued{};

  public:
    static constexpr auto LIFETIME = 10.0f;

    resource::xml::Schema::Element* entry{};

    bool isEnabled{true};
    float time{};

    void set(resource::xml::Schema::Element*, Entity&, bool isInterruptible = true);
    void update(Entity&, Canvas&);
    bool is_interruptible() const;
    bool is_finished() const;
    bool is_terminal() const;
  };
}
