Files
Daybreak/Daybreak.Shared/Models/LaunchConfigurations/GuildWarsApplicationLaunchContext.cs
T
amacocian 47369851f2 Configuration scoped modlist (#1423) (Closes #1225)
* Mod selection for each launch configuration (Closes #1225)

* Store enabled mods with the launched application
2026-02-11 14:22:43 -08:00

33 lines
1.1 KiB
C#

using System.Diagnostics;
using Daybreak.Shared.Services.Mods;
namespace Daybreak.Shared.Models.LaunchConfigurations;
public sealed record GuildWarsApplicationLaunchContext : IEquatable<GuildWarsApplicationLaunchContext>
{
public required LaunchConfigurationWithCredentials LaunchConfiguration { get; init; }
public required Process GuildWarsProcess { get; init; }
public required uint ProcessId { get; init; }
/// <summary>
/// The list of mod services that were enabled when this process was launched.
/// This is used to determine which mods are active for this specific instance.
/// </summary>
public IReadOnlyList<IModService> EnabledMods { get; init; } = [];
public GuildWarsApplicationLaunchContext()
{
}
public bool Equals(GuildWarsApplicationLaunchContext? other)
{
return this?.LaunchConfiguration.Equals(other?.LaunchConfiguration) is true &&
this?.GuildWarsProcess.Id == other?.GuildWarsProcess.Id;
}
public override int GetHashCode()
{
return HashCode.Combine(this.LaunchConfiguration, this.GuildWarsProcess.Id);
}
}