잡 기반 구현

This commit is contained in:
2025-12-07 05:29:06 +09:00
parent 61d43ef61e
commit 44e87f1334
2 changed files with 72 additions and 6 deletions

View File

@@ -24,13 +24,18 @@ namespace WarhoundConsole
{
Singleton.I.Initialize(new());
var jobs = new List<Job>();
var sw = Stopwatch.StartNew();
while (!Singleton.I.ExitRequested)
{
try
{
sw.Restart();
MainLoop();
foreach (var job in jobs)
{
_ = job.TryExecute();
}
sw.Stop();
const int targetFrameTimeMs = 10;
@@ -45,14 +50,14 @@ namespace WarhoundConsole
}
}
foreach (var job in jobs)
{
job.Wait();
}
Shutdown();
}
private static void MainLoop()
{
}
private static void Shutdown()
{
// DO SOMETHING