Files
Daybreak/Daybreak.Shared/Models/LaunchConfigurations/LaunchConfigurationWithCredentials.cs
T
amacocian ab1b604aec Code cleanup (#1026)
* Resolve warnings and move shared props to Directory.Build.props and Directory.Packages.props

* Cleanup more messages

* Fix more messages

* Fix build issues
2025-06-29 17:32:52 +02:00

42 lines
1.4 KiB
C#

namespace Daybreak.Shared.Models.LaunchConfigurations;
public sealed class LaunchConfigurationWithCredentials : IEquatable<LaunchConfigurationWithCredentials>
{
public string? Identifier { get; init; }
public string? ExecutablePath { get; set; }
public string? Arguments { get; set; }
public LoginCredentials? Credentials { get; set; }
public bool Equals(LaunchConfigurationWithCredentials? other)
{
if (other is null)
{
return false;
}
return this?.Identifier?.Equals(other?.Identifier) is true &&
this?.ExecutablePath?.Equals(other?.ExecutablePath) is not false && //ExecutablePath can be null, so in that case the comparison returns null
this?.Credentials?.Equals(other?.Credentials) is true;
}
public override bool Equals(object? obj)
{
return this.Equals(obj as LaunchConfigurationWithCredentials);
}
public override int GetHashCode()
{
return HashCode.Combine(this.ExecutablePath, this.Credentials?.GetHashCode());
}
public static bool operator ==(LaunchConfigurationWithCredentials l1, LaunchConfigurationWithCredentials l2)
{
return l1?.Equals(l2) is true;
}
public static bool operator !=(LaunchConfigurationWithCredentials l1, LaunchConfigurationWithCredentials l2)
{
return l1?.Equals(l2) is not true;
}
}