/// <summary> /// 分配一个实例 /// </summary> /// <typeparam name="T"> RecyclableObject </typeparam> /// <param name=" envType"></param> /// <returns></returns> public static T Allocate <T>(EnvironmentType envType) where T : RecyclableObject { var _env = Framework.GetEnv(envType); return(Allocate <T>(_env)); }
/// <summary> /// 分配一个实例 /// </summary> /// <param name="type">类型</param> /// <param name=" envType"></param> /// <returns></returns> public static RecyclableObject Allocate(Type type, EnvironmentType envType) { var _env = Framework.GetEnv(envType); return(Allocate(type, _env)); }
/// <summary> /// 回收所有实例 /// </summary> /// <param name="envType"></param> public static void RecyleAll(EnvironmentType envType) { var _env = Framework.GetEnv(envType); RecyleAll(_env); }
/// <summary> /// 获取没有回收的实例 /// </summary> /// <param name="envType"></param> /// <param name="id"></param> /// <param name="obj"></param> /// <returns></returns> public static bool GetFromMemory(EnvironmentType envType, Guid id, out RecyclableObject obj) { var _env = Framework.GetEnv(envType); return(GetFromMemory(_env, id, out obj)); }
/// <summary> /// 通过唯一id回收对象 /// </summary> /// <param name="envType"></param> /// <param name="guid"></param> public static void RecyleByGuid(EnvironmentType envType, Guid guid) { var _env = Framework.GetEnv(envType); RecyleByGuid(_env, guid); }