mirror of
https://github.com/Ale32bit/Capy64.git
synced 2025-01-31 08:16:42 +00:00
927a2e253a
Clean up of all the code
27 lines
No EOL
802 B
C#
27 lines
No EOL
802 B
C#
using Capy64;
|
|
using Microsoft.Extensions.Configuration;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Hosting;
|
|
using System.IO;
|
|
|
|
using var game = new Capy64.Capy64();
|
|
using IHost host = Host.CreateDefaultBuilder(args)
|
|
.ConfigureAppConfiguration((context, c) =>
|
|
{
|
|
var settingsPath = Path.Combine(Capy64.Capy64.AppDataPath, "settings.json");
|
|
if (!File.Exists(settingsPath))
|
|
{
|
|
File.Copy("Assets/default.json", settingsPath);
|
|
}
|
|
|
|
c.AddJsonFile("Assets/default.json", false);
|
|
c.AddJsonFile(settingsPath, false);
|
|
})
|
|
.ConfigureServices((hostContext, services) =>
|
|
{
|
|
services.AddSingleton<IGame>(game);
|
|
services.AddHostedService<Worker>();
|
|
})
|
|
.Build();
|
|
|
|
await host.RunAsync(); |