mirror of
https://github.com/DCFApixels/DragonECS-Graphs.git
synced 2025-09-17 19:24:36 +08:00
Update GraphQueries.cs
This commit is contained in:
parent
879a04eccb
commit
a6d35ddb55
@ -1,8 +1,9 @@
|
|||||||
using DCFApixels.DragonECS.Graphs.Internal;
|
using DCFApixels.DragonECS.Core;
|
||||||
|
using DCFApixels.DragonECS.Graphs.Internal;
|
||||||
|
|
||||||
namespace DCFApixels.DragonECS
|
namespace DCFApixels.DragonECS
|
||||||
{
|
{
|
||||||
public static class GraphQueries
|
public static class GraphQueriesExtensions
|
||||||
{
|
{
|
||||||
#region JoinToGraph Empty
|
#region JoinToGraph Empty
|
||||||
public static EcsSubGraph JoinToSubGraph(this EcsWorld entities, EcsSubGraphMode mode = EcsSubGraphMode.StartToEnd)
|
public static EcsSubGraph JoinToSubGraph(this EcsWorld entities, EcsSubGraphMode mode = EcsSubGraphMode.StartToEnd)
|
||||||
@ -38,6 +39,28 @@ namespace DCFApixels.DragonECS
|
|||||||
//}
|
//}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region JoinToGraph Mask
|
||||||
|
public static EcsSubGraph JoinToSubGraph<TCollection>(this TCollection entities, IComponentMask mask, EcsSubGraphMode mode = EcsSubGraphMode.StartToEnd)
|
||||||
|
where TCollection : IEntityStorage
|
||||||
|
{
|
||||||
|
if (ReferenceEquals(entities, entities.World))
|
||||||
|
{
|
||||||
|
var executor = entities.World.GetExecutorForMask<JoinToSubGraphExecutor>(mask);
|
||||||
|
return executor.Execute();
|
||||||
|
}
|
||||||
|
return entities.ToSpan().JoinToSubGraph(mask, mode);
|
||||||
|
}
|
||||||
|
public static EcsSubGraph JoinToSubGraph(this EcsReadonlyGroup group, IComponentMask mask, EcsSubGraphMode mode = EcsSubGraphMode.StartToEnd)
|
||||||
|
{
|
||||||
|
return group.ToSpan().JoinToSubGraph(mask, mode);
|
||||||
|
}
|
||||||
|
public static EcsSubGraph JoinToSubGraph(this EcsSpan span, IComponentMask mask, EcsSubGraphMode mode = EcsSubGraphMode.StartToEnd)
|
||||||
|
{
|
||||||
|
var executor = span.World.GetExecutorForMask<JoinToSubGraphExecutor>(mask);
|
||||||
|
return executor.ExecuteFor(span, mode);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region JoinToGraph
|
#region JoinToGraph
|
||||||
public static EcsSubGraph JoinToSubGraph<TCollection, TAspect>(this TCollection entities, out TAspect aspect, EcsSubGraphMode mode = EcsSubGraphMode.StartToEnd)
|
public static EcsSubGraph JoinToSubGraph<TCollection, TAspect>(this TCollection entities, out TAspect aspect, EcsSubGraphMode mode = EcsSubGraphMode.StartToEnd)
|
||||||
where TAspect : EcsAspect, new()
|
where TAspect : EcsAspect, new()
|
||||||
|
Loading…
Reference in New Issue
Block a user