using System.Collections.Generic; namespace AlicizaX { /// /// A buffer that stores data that can be used for serializing data or do other operations. ///
Implements where the key is and the value is .
///
public class StorableCollection : Dictionary { public T GetT(string key) { if (TryGetValue(key, out var value)) if (value is T valueT) return valueT; throw new System.NullReferenceException($"Could not find item with key '{key}' or could not convert to type '{typeof(T).Name}'."); } public bool TryGetValue(string key, out T value) { if (TryGetValue(key, out var valueO)) { if (valueO is T valueT) { value = valueT; return true; } } value = default; return false; } } }