//
// Created by sasha on 01.12.2025.
//

#ifndef RU_DANSOFT_PUZZLE15_TIMER_H
#define RU_DANSOFT_PUZZLE15_TIMER_H

#include "iwidget.h"

class Timer  : public IWidget {
    public:
        Timer(IWidget *parent);
        void start(Uint64 interval_msec,std::function<void()> func);
        void start();
        void stop();

        void draw() override;
        void iterate() override;

    private:
        Uint64 basket_time;
        Uint64 lastTicks;

        bool timer_run;
        Uint64 interval;
        std::function<void()> onTime;
};


#endif //RU_DANSOFT_PUZZLE15_TIMER_H
