mirror of
https://github.com/sp-tarkov/loot-dump-processor.git
synced 2025-02-13 09:50:44 -05:00
43 lines
888 B
C#
43 lines
888 B
C#
using System.Text.Json.Serialization;
|
|
|
|
|
|
namespace LootDumpProcessor.Model;
|
|
|
|
public class Item : ICloneable
|
|
{
|
|
[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)
|
|
{
|
|
if (obj is not Item parsed)
|
|
return false;
|
|
return parsed.Tpl == Tpl && parsed.ParentId == ParentId;
|
|
}
|
|
|
|
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,
|
|
Upd = Upd
|
|
};
|
|
} |