using System.Collections.Generic; namespace gaemstone.Utility; public static class CallbackContextHelper { private static readonly List _contexts = new(); public static nint Create(T context) where T : notnull { _contexts.Add(context); return _contexts.Count; } public static T Get(nint context) => (T)_contexts[(int)context - 1]; }