Files
launcher-next/Launcher.Next.Application/PrepareLaunchUseCase.cs
T

15 lines
832 B
C#

using Launcher.Next.Core;
namespace Launcher.Next.Application;
public sealed class PrepareLaunchUseCase(IProductDiscovery discovery, IAutodeskProcessLauncher launcher, ILauncherTelemetry telemetry)
{
public PreparedLaunch Execute(int year, string profile, string scriptPath)
{
telemetry.Write("ProductDiscoveryStarted");
var product = discovery.DiscoverPlant3D(year) ?? throw new InvalidOperationException("PLANT_PRODUCT_NOT_FOUND");
telemetry.Write("ProductDiscovered", new Dictionary<string, object?> { ["version"] = product.ProductVersion, ["architecture"] = product.Architecture });
var prepared = launcher.Prepare(new(product, profile, scriptPath, true));
telemetry.Write("LaunchPrepared", new Dictionary<string, object?> { ["dryRun"] = true });
return prepared;
}
}