diff --git a/MareSynchronosAPI/FileReplacementDto.cs b/MareSynchronosAPI/FileReplacementDto.cs index 57aa2cb..9156856 100644 --- a/MareSynchronosAPI/FileReplacementDto.cs +++ b/MareSynchronosAPI/FileReplacementDto.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; namespace MareSynchronos.API { @@ -6,5 +7,21 @@ namespace MareSynchronos.API { public string[] GamePaths { get; set; } = Array.Empty(); public string Hash { get; set; } + + public override int GetHashCode() + { + return HashCode.Combine(GetOrderIndependentHashCode(GamePaths), Hash); + } + + public static int GetOrderIndependentHashCode(IEnumerable source) + { + int hash = 0; + foreach (T element in source) + { + hash = unchecked(hash + + EqualityComparer.Default.GetHashCode(element)); + } + return hash; + } } } \ No newline at end of file