#include <DatSubsystems/DatStatus.h>
#include <DatFile.h>

namespace LOTRO_DAT {
    void DatStatus::SetPercentage(unsigned percent) {
        percentage_ = std::min(100u, percent);
    }

    unsigned DatStatus::GetPercentage() {
        return percentage_;
    }

    bool DatStatus::CheckIfNotPatched() {
        return dat->GetLocaleManager().patch_dict_.empty();
    }

    DatStatus::DatStatus(DatFile *datFilePtr) : dat(datFilePtr), percentage_(0), status_(E_FREE) {
    }

    void DatStatus::ClearAll() {
        debug_message = "";
        status_ = E_FREE;
    }

    void DatStatus::SetStatus(DatStatus::DAT_STATUS status) {
        status_ = status;

    }

    DatStatus::DAT_STATUS DatStatus::GetStatus() {
        return status_;
    }

    void DatStatus::SetDebugMessage(const std::string &message) {
        debug_message = message;

    }

    std::string DatStatus::GetDebugMessage() {
        return debug_message;
    }
}