DragonECS/src/Interfaces/IEcsTable.cs

35 lines
1.0 KiB
C#
Raw Normal View History

2023-04-06 11:50:31 +08:00
using System;
2023-04-08 00:47:35 +08:00
using System.Runtime.CompilerServices;
2023-04-06 11:50:31 +08:00
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-06 11:50:31 +08:00
public EcsPool<T> GetPool<T>() where T : struct;
2023-04-20 18:23:23 +08:00
public ReadOnlySpan<IEcsPool> GetAllPools();
2023-04-20 10:59:55 +08:00
public TQuery Where<TQuery>(out TQuery query) where TQuery : EcsQueryBase;
public TQuery Select<TQuery>() where TQuery : EcsQueryBase;
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
}
}