2024-04-16 18:29:40 +00:00
|
|
|
using System.Text.Json.Serialization;
|
2025-01-11 10:52:23 +03:00
|
|
|
|
2023-08-12 19:08:38 +01:00
|
|
|
|
|
|
|
namespace LootDumpProcessor.Model;
|
|
|
|
|
2025-01-11 09:12:21 +03:00
|
|
|
public class ComposedKey(string key, Item? firstItem)
|
2023-08-12 19:08:38 +01:00
|
|
|
{
|
2025-01-11 10:52:23 +03:00
|
|
|
public string Key { get; init; } = key;
|
2023-08-12 19:08:38 +01:00
|
|
|
|
2025-01-11 10:52:23 +03:00
|
|
|
[JsonIgnore] public Item? FirstItem { get; } = firstItem;
|
2023-08-12 19:08:38 +01:00
|
|
|
|
|
|
|
public override bool Equals(object? obj)
|
|
|
|
{
|
|
|
|
if (obj is not ComposedKey key)
|
|
|
|
return false;
|
2024-04-16 18:29:40 +00:00
|
|
|
return Key == key.Key;
|
2023-08-12 19:08:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public override int GetHashCode() => Key.GetHashCode();
|
|
|
|
}
|