잡 기반 구현
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user