namespace Qrakhen.Qamp.Core.Collections; public class Register : IGetSet where TKey : notnull { private readonly Dictionary _data = new(); public int Length => _data.Count; public TValue this[TKey key] { get => Get(key); set => Set(key, value); } public TKey Add(TKey key, TValue value) { _data.Add(key, value); return key; } public TValue Get(TKey key) => _data[key]; public void Set(TKey key, TValue value) => _data[key] = value; public bool Has(TKey key) => _data.ContainsKey(key); }