#ifndef TIMER_HPP #define TIMER_HPP #include #include #include #include #include #include class timer { private: double accumulator = 0; int triggeramount = 0; double time_interval = 1; // only display every 1 seconds public: std::string name; int triggercounter = 0; bool is_infinite = false; std::function callbackfunc; bool is_expired = false; //infinite timer timer(std::string name_input, size_t interval_input, std::function callback_input); //limited timer timer(std::string name, size_t interval_input, int triggeramount, std::function callback); // callbackfunc once enough time has accumulated void updatetime(double DeltaTime); }; // manage collection of timers class timermanager { std::vector> timers; public: void addtimer(std::unique_ptr input_timer); void updatetimers(double dtime); }; #endif