adjust DTOs
This commit is contained in:
@@ -1,13 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace MareSynchronos.API
|
||||
{
|
||||
public record FileReplacementDto
|
||||
public class FileReplacementDto
|
||||
{
|
||||
public string[] GamePaths { get; set; } = Array.Empty<string>();
|
||||
public string Hash { get; set; }
|
||||
|
||||
public override bool Equals(object? otherObj)
|
||||
{
|
||||
if (otherObj == null || otherObj is not FileReplacementDto other) return false;
|
||||
return Hash == other.Hash && Enumerable.SequenceEqual(GamePaths, other.GamePaths);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return HashCode.Combine(GetOrderIndependentHashCode(GamePaths), Hash);
|
||||
@@ -23,5 +30,10 @@ namespace MareSynchronos.API
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Hash + ":" + string.Join(",", GamePaths);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user