DragonECS/src/Interfaces/IEcsTable.cs

35 lines
1.1 KiB
C#
Raw Normal View History

2023-04-06 11:50:31 +08:00
using System;
namespace DCFApixels.DragonECS
{
2023-04-18 19:35:42 +08:00
public interface IEcsTable
2023-04-06 11:50:31 +08:00
{
#region Properties
2023-04-06 23:40:47 +08:00
/// <summary>Table Archetype</summary>
2023-04-20 19:23:58 +08:00
public Type Archetype { get; }
2023-04-08 00:47:35 +08:00
public int Count { get; }
public int Capacity { get; }
2023-04-20 10:59:55 +08:00
public EcsReadonlyGroup Entities => default;
2023-04-06 11:50:31 +08:00
#endregion
2023-04-06 23:40:47 +08:00
#region Methods
2023-04-20 10:59:55 +08:00
public int GetComponentID<T>();
2023-04-22 23:40:09 +08:00
public TPool GetPool<TComponent, TPool>() where TComponent : struct where TPool : EcsPoolBase<TComponent>, new();
2023-04-21 03:16:05 +08:00
public ReadOnlySpan<EcsPoolBase> GetAllPools();
2023-04-20 10:59:55 +08:00
public TQuery Select<TQuery>() where TQuery : EcsQueryBase;
2023-04-21 14:21:24 +08:00
public TQuery Where<TQuery>(out TQuery query) where TQuery : EcsQuery;
2023-04-21 16:03:50 +08:00
// public TQuery Join<TQuery>(out TQuery query) where TQuery : EcsJoinQueryBase;
2023-04-06 11:50:31 +08:00
2023-04-08 00:47:35 +08:00
public bool IsMaskCompatible(EcsComponentMask mask, int entityID);
2023-04-20 10:59:55 +08:00
public void Destroy();
2023-04-06 23:40:47 +08:00
#endregion
2023-04-06 11:50:31 +08:00
2023-04-06 23:40:47 +08:00
#region Internal Methods
2023-04-06 11:50:31 +08:00
internal void RegisterGroup(EcsGroup group);
2023-04-20 10:59:55 +08:00
internal EcsGroup GetGroupFromPool();
internal void ReleaseGroup(EcsGroup group);
2023-04-06 11:50:31 +08:00
#endregion
}
}