-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
48 lines (40 loc) · 1.18 KB
/
Program.cs
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
44
45
46
47
48
using System;
using System.Threading;
using System.Threading.Tasks;
using Autofac;
using Avalonia;
using Exanite.Engine.Avalonia;
using Exanite.Engine.Framework;
using Exanite.Logging;
namespace Exanite.GravitationalTetris;
public static class Program
{
public const string CompanyName = "Exanite";
public const string GameName = "GravitationalTetris";
[STAThread]
public static async Task Main(string[] args)
{
var exitCode = 0;
{
Thread.CurrentThread.Name = "Main";
var settings = new EngineSettings(CompanyName, GameName);
await using var game = new Game1(settings);
try
{
game.Initialize();
game.Run();
}
catch (Exception e)
{
LoggingUtility.LogProgramCrash(settings.Paths.LogsFolder, typeof(Program), e);
exitCode = 1;
}
}
Environment.Exit(exitCode);
}
public static AppBuilder BuildAvaloniaApp()
{
var settings = new EngineSettings(CompanyName, GameName);
return new Game1(settings).Initialize().Resolve<AvaloniaContext>().Start(true);
}
}