fix: make dedupe work correctly

This commit is contained in:
Anna 2024-02-18 11:48:25 -05:00
parent 8517a4bae4
commit 085b1c3edb
Signed by: anna
GPG Key ID: D0943384CD9F87D1
1 changed files with 25 additions and 3 deletions

View File

@ -141,7 +141,7 @@ public class ScreenshotMetadata {
}
}
foreach (var mod in modsInUse) {
foreach (var mod in modsInUse.OrderBy(mod => mod.Name)) {
Plugin.Log.Info($"{mod.Name} at {mod.Path}");
}
@ -232,6 +232,28 @@ public struct EorzeaTime {
[Serializable]
public class PenumbraMod {
public required string Path;
public required string Name;
public required string Path { get; init; }
public required string Name { get; init; }
protected bool Equals(PenumbraMod other) {
return this.Path == other.Path && this.Name == other.Name;
}
public override bool Equals(object? obj) {
if (ReferenceEquals(null, obj)) {
return false;
}
if (ReferenceEquals(this, obj)) {
return true;
}
return obj.GetType() == this.GetType() && this.Equals((PenumbraMod) obj);
}
public override int GetHashCode() {
unchecked {
return (this.Path.GetHashCode() * 397) ^ this.Name.GetHashCode();
}
}
}