#pragma once
#include "node.h"
#include "node_button.h"
#include "node_text.h"
#include "node_border.h"

class NodeProgressBar : public NodeBorder
{
public:
    Node* m_template;
    NodeButton* btn_cancel;
    NodeText* m_title;
    NodeBorder* m_progress;
    NodeBorder* m_body;
    int m_total = 0;
    std::atomic_int m_count{0};
    virtual Node* clone_instantiate() const override;
    virtual void init() override;
    void increment() noexcept;
    // set progress where p [0, 1]
    void set_progress(float p) noexcept;
    virtual void added(Node* parent) override;
};
