#ifndef BASETASK_H
#define BASETASK_H

enum class TaskTypeEnum {
    Export,
    Bot,
    Test,
    NotDefined
};

class ExecutableTask {
public:
    ExecutableTask() : finished(false) {
    }

    virtual ~ExecutableTask() = default;

    virtual void Execute() = 0;

    [[nodiscard]]
    virtual TaskTypeEnum TaskType() const = 0;

    void RequestStop() {
        stopRequested = true;
    }

    [[nodiscard]] bool IsStopRequested() const {
        return stopRequested;
    }

    [[nodiscard]] bool IsFinished() const {
        return finished;
    }

protected:
    void MarkFinished() {
        finished = true;
    }

    bool stopRequested = false;

private:
    bool finished;
};

#endif //BASETASK_H
