LootDumpProcessor/Storage/Collections/FlatKeyableDictionary.cs

17 lines
424 B
C#
Raw Permalink Normal View History

using System.Text.Json.Serialization;
using LootDumpProcessor.Utils;
2023-08-12 19:08:38 +01:00
using Newtonsoft.Json;
namespace LootDumpProcessor.Storage.Collections;
public class FlatKeyableDictionary<K, V> : Dictionary<K, V>, IKeyable
{
[JsonProperty("__id__")]
[JsonPropertyName("__id__")]
public string __ID { get; set; } = KeyGenerator.GetNextKey();
2023-08-12 19:08:38 +01:00
public IKey GetKey()
{
return new FlatUniqueKey([__ID]);
2023-08-12 19:08:38 +01:00
}
}