2024-04-16 18:29:40 +00:00
|
|
|
using System.Text.Json.Serialization;
|
2023-08-12 19:08:38 +01:00
|
|
|
|
2025-01-11 10:52:23 +03:00
|
|
|
|
|
|
|
namespace LootDumpProcessor.Model;
|
|
|
|
|
|
|
|
public class Item : ICloneable
|
2023-08-12 19:08:38 +01:00
|
|
|
{
|
2025-01-11 10:52:23 +03:00
|
|
|
[JsonPropertyName("_id")] public string? Id { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("_tpl")] public string? Tpl { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public Upd? Upd { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public string? ParentId { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public string? SlotId { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public object? Location { get; set; }
|
|
|
|
|
|
|
|
public override bool Equals(object? obj)
|
2023-08-12 19:08:38 +01:00
|
|
|
{
|
2025-01-11 10:52:23 +03:00
|
|
|
if (obj is not Item parsed)
|
|
|
|
return false;
|
|
|
|
return parsed.Tpl == Tpl && parsed.ParentId == ParentId;
|
2023-08-12 19:08:38 +01:00
|
|
|
}
|
2025-01-11 10:52:23 +03:00
|
|
|
|
|
|
|
public override int GetHashCode() => Tpl?.GetHashCode() + ParentId?.GetHashCode() ?? base.GetHashCode();
|
|
|
|
|
|
|
|
public object Clone() => new Item
|
|
|
|
{
|
|
|
|
Id = Id,
|
|
|
|
Tpl = Tpl,
|
|
|
|
ParentId = ParentId,
|
|
|
|
SlotId = SlotId,
|
|
|
|
Location = Location,
|
2025-01-11 12:15:01 +03:00
|
|
|
Upd = Upd
|
2025-01-11 10:52:23 +03:00
|
|
|
};
|
2023-08-12 19:08:38 +01:00
|
|
|
}
|