2021-04-19 18:56:11 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace scheduler
|
|
|
|
{
|
|
|
|
enum pipeline
|
|
|
|
{
|
|
|
|
// Asynchronuous pipeline, disconnected from the game
|
|
|
|
async = 0,
|
|
|
|
|
|
|
|
// The game's rendering pipeline
|
|
|
|
renderer,
|
|
|
|
|
2022-02-06 15:36:49 -05:00
|
|
|
lui,
|
|
|
|
|
2021-04-19 18:56:11 -04:00
|
|
|
// The game's server thread
|
|
|
|
server,
|
|
|
|
|
|
|
|
// The game's main thread
|
|
|
|
main,
|
|
|
|
|
|
|
|
count,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const bool cond_continue = false;
|
|
|
|
static const bool cond_end = true;
|
|
|
|
|
|
|
|
void schedule(const std::function<bool()>& callback, pipeline type = pipeline::async,
|
|
|
|
std::chrono::milliseconds delay = 0ms);
|
|
|
|
void loop(const std::function<void()>& callback, pipeline type = pipeline::async,
|
|
|
|
std::chrono::milliseconds delay = 0ms);
|
|
|
|
void once(const std::function<void()>& callback, pipeline type = pipeline::async,
|
|
|
|
std::chrono::milliseconds delay = 0ms);
|
2021-09-06 18:40:37 -04:00
|
|
|
void on_game_initialized(const std::function<void()>& callback, pipeline type = pipeline::async,
|
|
|
|
std::chrono::milliseconds delay = 0ms);
|
2021-04-19 18:56:11 -04:00
|
|
|
}
|