21
22
23
24
25
26
27
28 template <
typename Func,
typename... Args>
35
36
37
38
39
40
41
42
43
44 template <
typename Func,
typename... Args>
46 int execution_counter,
bool async, Args&&... args)
56 std::function<
void()> callback,
57 bool exec_once,
int execution_counter,
int execution_interval)
78 int execution_counter,
bool async);
virtual std::unique_ptr< ArkApi::ICommands > & GetCommands()=0
void RecurringExecute(const Func &callback, int execution_interval, int execution_counter, bool async, Args &&... args)
Executes function every X seconds.
Timer(const Timer &)=delete
ARK_API void RecurringExecuteInternal(const std::function< void()> &callback, int execution_interval, int execution_counter, bool async)
Timer & operator=(Timer &&)=delete
ARK_API void DelayExecuteInternal(const std::function< void()> &callback, int delay_seconds)
static ARK_API Timer & Get()
void DelayExecute(const Func &callback, int delay, Args &&... args)
Executes function after X seconds.
std::vector< std::unique_ptr< TimerFunc > > timer_funcs_
Timer & operator=(const Timer &)=delete
virtual bool RemoveOnTimerCallback(const FString &id)=0
Removes an on-timer callback.
virtual void AddOnTimerCallback(const FString &id, const std::function< void()> &callback)=0
Added function will be called every second.
std::unique_ptr< IBaseApi > game_api
TimerFunc(const std::chrono::time_point< std::chrono::system_clock > &next_time, std::function< void()> callback, bool exec_once, int execution_counter, int execution_interval)
std::function< void()> callback
std::chrono::time_point< std::chrono::system_clock > next_time