diff --git a/src/EntityGraph.cs b/src/EntityGraph.cs index 536d0f2..ce03636 100644 --- a/src/EntityGraph.cs +++ b/src/EntityGraph.cs @@ -280,7 +280,6 @@ namespace DCFApixels.DragonECS EcsSubGraph subGraph; EcsWorld graphWorld = _graph._graphWorld; - //subGraph = graphWorld.JoinToSubGraph(EcsSubGraphMode.StartToEnd); subGraph = graphWorld.JoinToSubGraph(EcsSubGraphMode.All); foreach (var sourceE in delEntities) { @@ -292,17 +291,6 @@ namespace DCFApixels.DragonECS } } - //subGraph = graphWorld.JoinToSubGraph(EcsSubGraphMode.EndToStart); - //foreach (var sourceE in delEntities) - //{ - // var relEs = subGraph.GetRelations(sourceE); - // foreach (var relE in relEs) - // { - // //int missingE = graphWorld.NewEntity(); - // _graph.DelRelation(relE); - // } - //} - graphWorld.ReleaseDelEntityBufferAll(); } public void OnWorldDestroy() { } diff --git a/src/Executors/GraphQueries.cs b/src/Executors/GraphQueries.cs index 6824205..29f3759 100644 --- a/src/Executors/GraphQueries.cs +++ b/src/Executors/GraphQueries.cs @@ -5,11 +5,23 @@ namespace DCFApixels.DragonECS public static class GraphQueries { #region JoinToGraph Empty + public static EcsSubGraph JoinToSubGraph(this EcsWorld entities, EcsSubGraphMode mode = EcsSubGraphMode.StartToEnd) + { + entities.GetQueryCache(out JoinToSubGraphExecutor executor, out EmptyAspect _); + return executor.Execute(mode); + } + //public static EcsSubGraph JoinToSubGraph(this TCollection entities, EcsSubGraphMode mode = EcsSubGraphMode.StartToEnd) // where TCollection : IEntityStorage //{ - // return entities.ToSpan().JoinToSubGraph(mode); + // if (ReferenceEquals(entities, entities.World)) + // { + // entities.World.GetQueryCache(out JoinToSubGraphExecutor executor, out EmptyAspect _); + // return executor.Execute(mode); + // } + // return entities.ToSpan().JoinToSubGraph(out EmptyAspect _, mode); //} + //public static EcsSubGraph JoinToSubGraph(this EcsReadonlyGroup group, EcsSubGraphMode mode = EcsSubGraphMode.StartToEnd) //{ // return group.ToSpan().JoinToSubGraph(mode); @@ -27,17 +39,6 @@ namespace DCFApixels.DragonECS #endregion #region JoinToGraph - public static EcsSubGraph JoinToSubGraph(this TCollection entities, EcsSubGraphMode mode = EcsSubGraphMode.StartToEnd) - where TCollection : IEntityStorage - { - if (ReferenceEquals(entities, entities.World)) - { - entities.World.GetQueryCache(out JoinToSubGraphExecutor executor, out EmptyAspect _); - return executor.Execute(mode); - } - return entities.ToSpan().JoinToSubGraph(out EmptyAspect _, mode); - } - public static EcsSubGraph JoinToSubGraph(this TCollection entities, out TAspect aspect, EcsSubGraphMode mode = EcsSubGraphMode.StartToEnd) where TAspect : EcsAspect, new() where TCollection : IEntityStorage diff --git a/src/Internal/OnlyAppendHeadLinkedList.cs b/src/Internal/OnlyAppendHeadLinkedList.cs index b8a70ae..e75e417 100644 --- a/src/Internal/OnlyAppendHeadLinkedList.cs +++ b/src/Internal/OnlyAppendHeadLinkedList.cs @@ -70,64 +70,6 @@ namespace DCFApixels.DragonECS.Graphs.Internal } #endregion - #region TMP - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - //public void Resize(int newCapacity) - //{ - // Array.Resize(ref _nodes, newCapacity * 2 + 10); - //} - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - //public void Set(HeadIndex nodeIndex, int entityID) - //{ - // _nodes[(int)nodeIndex].entityID = entityID; - //} - - ///// new node index - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - //public NodeID InsertBefore(NodeID nodeIndex, int entityID) - //{ - // NodeID newNode = (NodeID)(++_count); - // _nodes[(int)newNode] = _nodes[(int)nodeIndex]; - // _nodes[(int)newNode].Set(entityID, nodeIndex); - // return newNode; - //} - ///// new node index - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - //public NodeID InsertAfter(NodeID nodeIndex, int entityID) - //{ - // NodeID newNode = (NodeID)(++_count); - // _nodes[(int)nodeIndex].next = newNode; - // _nodes[(int)newNode].Set(entityID, _nodes[(int)nodeIndex].next); - // _lastNodeIndex = newNode; - // return newNode; - // - // //_nodes[++_count].Set(entityID, _nodes[(int)nodeIndex].next); - // //_nodes[(int)nodeIndex].next = (NodeID)_count; - // //_lastNodeIndex = (NodeID)((int)nodeIndex + 1); - // //return (NodeID)_count; - //} - /// new node index - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - //public NodeID Add(int entityID) - //{ - // var result = InsertAfter(_lastNodeIndex, entityID); - // _lastNodeIndex = (NodeID)_count; - // return result; - //} - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - //public EcsJoinedSpan GetSpan(int startNodeIndex, int count) - //{ - // return new EcsJoinedSpan(_nodes, startNodeIndex, count); - //} - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - //public EcsJoinedSpan GetEmptySpan() - //{ - // return new EcsJoinedSpan(_nodes, 0, 0); - //} - #endregion - #region Utils public enum NodeIndex : int { }