public static void Remove(IUniversalLauncherShell shell, byte userId) { var pools = m_objectsPools[userId]; IUniversalLauncherShellsPool pool = pools[shell.GetType()]; pool.Remove(shell); MyEntities.RemoveFromClosedEntities(shell as MyEntity); }
// Add new shell to the list public static T Allocate <T>(byte userId) where T : class, IUniversalLauncherShell, new() { var pools = m_objectsPools[userId]; IUniversalLauncherShellsPool pool = pools[typeof(T)]; T newItem = pool.Allocate <T>(); return(newItem); }