modify
This commit is contained in:
parent
44ad68fc7f
commit
68a6a7fcfa
@ -2,95 +2,65 @@
|
|||||||
|
|
||||||
namespace AlicizaX.ObjectPool
|
namespace AlicizaX.ObjectPool
|
||||||
{
|
{
|
||||||
|
public interface IObjectPool
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 对象池接口。
|
/// 对象池接口。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <typeparam name="T">对象类型。</typeparam>
|
/// <typeparam name="T">对象类型。</typeparam>
|
||||||
public interface IObjectPool<T> where T : ObjectBase
|
public interface IObjectPool<T> : IObjectPool where T : ObjectBase
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取对象池名称。
|
/// 获取对象池名称。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
string Name
|
string Name { get; }
|
||||||
{
|
|
||||||
get;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取对象池完整名称。
|
/// 获取对象池完整名称。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
string FullName
|
string FullName { get; }
|
||||||
{
|
|
||||||
get;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取对象池对象类型。
|
/// 获取对象池对象类型。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Type ObjectType
|
Type ObjectType { get; }
|
||||||
{
|
|
||||||
get;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取对象池中对象的数量。
|
/// 获取对象池中对象的数量。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
int Count
|
int Count { get; }
|
||||||
{
|
|
||||||
get;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取对象池中能被释放的对象的数量。
|
/// 获取对象池中能被释放的对象的数量。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
int CanReleaseCount
|
int CanReleaseCount { get; }
|
||||||
{
|
|
||||||
get;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取是否允许对象被多次获取。
|
/// 获取是否允许对象被多次获取。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
bool AllowMultiSpawn
|
bool AllowMultiSpawn { get; }
|
||||||
{
|
|
||||||
get;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置对象池自动释放可释放对象的间隔秒数。
|
/// 获取或设置对象池自动释放可释放对象的间隔秒数。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
float AutoReleaseInterval
|
float AutoReleaseInterval { get; set; }
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置对象池的容量。
|
/// 获取或设置对象池的容量。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
int Capacity
|
int Capacity { get; set; }
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置对象池对象过期秒数。
|
/// 获取或设置对象池对象过期秒数。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
float ExpireTime
|
float ExpireTime { get; set; }
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置对象池的优先级。
|
/// 获取或设置对象池的优先级。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
int Priority
|
int Priority { get; set; }
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 创建对象。
|
/// 创建对象。
|
||||||
|
Loading…
Reference in New Issue
Block a user