-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProgram.cs
More file actions
43 lines (35 loc) · 1.18 KB
/
Copy pathProgram.cs
File metadata and controls
43 lines (35 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using Utilities;
using Utilities.Data;
using RenderEngine;
namespace Program;
internal static class Program
{
private static readonly LogStreamer LogStreamer = new();
private static Logger? Log;
private static SharedData? Data;
public static async Task Main(string[] args)
{
Data = new();
Log = new("main", LogStreamer, Data);
Logger LogRenderer = new("renderer", LogStreamer, Data);
RendererTimings Timings = new(Data);
Renderer Renderer = new Renderer()
.AddLogger(LogRenderer)
.AddData(Data)
.AddTimingsManager(Timings);
Log.Info("[==========================================]");
Log.Info(" Welcome to Slam's Fun Console Rendering");
Log.Info($" Project v{Data.Properties.Release}");
Log.Info("[==========================================]");
await Renderer.Initialize();
Cleanup(0);
}
public static void Cleanup(int exitCode)
{
Console.Clear();
Log.Info($"Exiting Application with exit code: {exitCode}", true);
LogStreamer.Cleanup();
Data.Save();
Environment.Exit(exitCode);
}
}