namespace GFramework.Core.Abstractions.pool;
///
/// 对象池系统接口,定义了对象池的基本操作
///
/// 池键的类型
/// 池中对象的类型,必须实现IPoolableObject接口
public interface IObjectPoolSystem
where TObject : IPoolableObject
where TKey : notnull
{
///
/// 从对象池中获取一个对象实例
///
/// 对象池的键
/// 池中的对象实例,如果池中没有可用对象则创建新实例
TObject Acquire(TKey key);
///
/// 将对象释放回对象池
///
/// 对象池的键
/// 要释放的对象
void Release(TKey key, TObject obj);
///
/// 清空所有对象池
///
void Clear();
}