mirror of
https://github.com/gwdevhub/Daybreak.git
synced 2026-07-15 15:19:57 +00:00
47369851f2
* Mod selection for each launch configuration (Closes #1225) * Store enabled mods with the launched application
33 lines
1.1 KiB
C#
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);
|
|
}
|
|
}
|