add simple filter method

This commit is contained in:
Mikhail 2023-04-02 22:36:08 +08:00
parent a1dadc033b
commit 26c9e50905

View File

@ -25,6 +25,7 @@ namespace DCFApixels.DragonECS
#region Methods #region Methods
public EcsPool<T> GetPool<T>() where T : struct; public EcsPool<T> GetPool<T>() where T : struct;
public EcsPool<T> UncheckedGetPool<T>() where T : struct; public EcsPool<T> UncheckedGetPool<T>() where T : struct;
public EcsFilter Entities<TComponent>() where TComponent : struct;
public EcsFilter Filter<TInc>() where TInc : struct, IInc; public EcsFilter Filter<TInc>() where TInc : struct, IInc;
public EcsFilter Filter<TInc, TExc>() where TInc : struct, IInc where TExc : struct, IExc; public EcsFilter Filter<TInc, TExc>() where TInc : struct, IInc where TExc : struct, IExc;
public ent NewEntity(); public ent NewEntity();
@ -172,6 +173,7 @@ namespace DCFApixels.DragonECS
#endregion #endregion
#region GetFilter #region GetFilter
public EcsFilter Entities<TComponent>() where TComponent : struct => Filter<Inc<TComponent>, Exc>();
public EcsFilter Filter<TInc>() where TInc : struct, IInc => Filter<TInc, Exc>(); public EcsFilter Filter<TInc>() where TInc : struct, IInc => Filter<TInc, Exc>();
public EcsFilter Filter<TInc, TExc>() where TInc : struct, IInc where TExc : struct, IExc public EcsFilter Filter<TInc, TExc>() where TInc : struct, IInc where TExc : struct, IExc
{ {