diff --git a/src/Collections/EcsGroup.cs b/src/Collections/EcsGroup.cs index fa0d3fb..b7b2cce 100644 --- a/src/Collections/EcsGroup.cs +++ b/src/Collections/EcsGroup.cs @@ -279,7 +279,6 @@ namespace DCFApixels.DragonECS [Il2CppSetOption(Option.ArrayBoundsChecks, false)] #endif [DebuggerTypeProxy(typeof(DebuggerProxy))] - //TODO переработать EcsGroup в структуру-обертку, чтобы когда вызывается Release то можно было занулить эту структуру, а может не перерабатывать, есть проблема с боксингом public unsafe class EcsGroup : IDisposable, IEnumerable, ISet, IEntityStorage { internal const int PAGE_SIZE = PageSlot.SIZE; diff --git a/src/DebugUtils/EcsDebug.cs b/src/DebugUtils/EcsDebug.cs index bdbb4a6..6e525a4 100644 --- a/src/DebugUtils/EcsDebug.cs +++ b/src/DebugUtils/EcsDebug.cs @@ -410,7 +410,6 @@ namespace DCFApixels.DragonECS.Core { self.Print(""); } - //TODO PrintJson возможно будет добавлено когда-то } #endregion diff --git a/src/EcsAspect.cs b/src/EcsAspect.cs index fa0ab91..3c35c3d 100644 --- a/src/EcsAspect.cs +++ b/src/EcsAspect.cs @@ -431,12 +431,10 @@ namespace DCFApixels.DragonECS { public readonly short worldID; public readonly EcsMaskIterator.Enumerable iterator; - private EcsSpan _span; public Iterator(EcsMaskIterator iterator, EcsSpan span) { worldID = iterator.World.ID; - _span = span; this.iterator = iterator.Iterate(span); } diff --git a/src/EcsMask.cs b/src/EcsMask.cs index 0ff600e..3521ad0 100644 --- a/src/EcsMask.cs +++ b/src/EcsMask.cs @@ -536,10 +536,6 @@ namespace DCFApixels.DragonECS #endif public class EcsMaskIterator : IDisposable { - // TODO есть идея перенести эти ChunckBuffer-ы в стек, - // для этого нужно проработать дизайн так чтобы память в стеке выделялась за пределами итератора и GetEnumerator, - // а далее передавались поинтеры, в противном случае использовался бы стандартный подход - public readonly EcsWorld World; public readonly EcsMask Mask; @@ -644,7 +640,6 @@ namespace DCFApixels.DragonECS UnsafeArraySortHalperX.InsertionSort(sortIncBuffer.ptr, sortIncBuffer.Length, ref comparer); ConvertToChuncks(preSortingBuffer, sortIncBuffer, _sortIncChunckBuffer); } - if (_sortIncChunckBuffer.Length > 0) { maxEntites = counts[_sortIncBuffer.ptr[0]].count; @@ -667,11 +662,12 @@ namespace DCFApixels.DragonECS if (_sortAnyChunckBuffer.Length > 1) { - //TODO проверить для Any ExcCountComparer comparer = new ExcCountComparer(counts); UnsafeArraySortHalperX.InsertionSort(sortAnyBuffer.ptr, sortAnyBuffer.Length, ref comparer); ConvertToChuncks(preSortingBuffer, sortAnyBuffer, _sortAnyChunckBuffer); } + // Any не влияет на maxEntites если есть Inc и сложно высчитывается если нет Inc + return maxEntites; } private unsafe bool TryGetEntityStorage(out IEntityStorage storage) @@ -759,6 +755,7 @@ namespace DCFApixels.DragonECS { private readonly EcsMaskIterator _iterator; private readonly EcsSpan _span; + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Enumerable(EcsMaskIterator iterator, EcsSpan span) { _iterator = iterator; @@ -879,28 +876,23 @@ namespace DCFApixels.DragonECS } } - //можно подумать над оптимизацией через кеширование bool значения, if с bool работает быстрее прочего - if(_sortAnyChunckBuffer.Length > 0) + if(_sortAnyChunckBuffer.Length != 0) { - int anyCount = 0; for (int i = 0; i < _sortAnyChunckBuffer.Length; i++) { var bit = _sortAnyChunckBuffer.ptr[i]; if ((_entityComponentMasks[entityLineStartIndex + bit.chunkIndex] & bit.mask) == bit.mask) { - anyCount++; + return true; } } - if (anyCount == 0) - { - goto skip; - } + goto skip; } return true; skip: continue; } - return false; + return false; //exit } } #endregion diff --git a/src/EcsRunner.cs b/src/EcsRunner.cs index 23bf070..32a015e 100644 --- a/src/EcsRunner.cs +++ b/src/EcsRunner.cs @@ -78,8 +78,6 @@ namespace DCFApixels.DragonECS bool IsEmpty { get; } } - //TODO инъекция в раннеры - //TODO добавить функцию фильтрации систем по string, за счет создания отдельных ранеров для отдельных string [MetaColor(MetaColor.DragonRose)] [MetaGroup(EcsConsts.PACK_GROUP, EcsConsts.OTHER_GROUP)] [MetaDescription(EcsConsts.AUTHOR, "...")] diff --git a/src/EcsStaticMask.cs b/src/EcsStaticMask.cs index 6c2a07f..840ac11 100644 --- a/src/EcsStaticMask.cs +++ b/src/EcsStaticMask.cs @@ -133,7 +133,6 @@ namespace DCFApixels.DragonECS #endregion #region Checks - //TODO доработать проверки с учетом Any public bool IsSubmaskOf(EcsStaticMask otherMask) { return IsSubmask(otherMask, this); diff --git a/src/EcsWorld.cs b/src/EcsWorld.cs index 51238f8..3425c50 100644 --- a/src/EcsWorld.cs +++ b/src/EcsWorld.cs @@ -604,25 +604,24 @@ namespace DCFApixels.DragonECS return false; } } - //TODO оптимизировать + if (anyChuncks.Length > 0) { - int count = 0; for (int i = 0; i < anyChuncks.Length; i++) { var bit = anyChuncks[i]; if ((_entityComponentMasks[componentMaskStartIndex + bit.chunkIndex] & bit.mask) == bit.mask) { - count++; +#if DEBUG && DRAGONECS_DEEP_DEBUG + if (true != deepDebug) { Throw.DeepDebugException(); } +#endif + return true; } } - if (count == 0) - { #if DEBUG && DRAGONECS_DEEP_DEBUG - if (false != deepDebug) { Throw.DeepDebugException(); } + if (false != deepDebug) { Throw.DeepDebugException(); } #endif - return false; - } + return false; } diff --git a/src/EcsWorld.static.cs b/src/EcsWorld.static.cs index 5ad7fca..95be601 100644 --- a/src/EcsWorld.static.cs +++ b/src/EcsWorld.static.cs @@ -182,7 +182,6 @@ namespace DCFApixels.DragonECS } } short itemIndex = _mapping[worldID]; - if (itemIndex == 0) { lock (_worldLock) diff --git a/src/Executors/MaskQueryExecutor.cs b/src/Executors/MaskQueryExecutor.cs index 160eabc..9008aad 100644 --- a/src/Executors/MaskQueryExecutor.cs +++ b/src/Executors/MaskQueryExecutor.cs @@ -107,8 +107,6 @@ namespace DCFApixels.DragonECS.Core protected abstract void OnDestroy(); } - - //TODO добавить Any #if ENABLE_IL2CPP [Il2CppSetOption(Option.NullChecks, false)] [Il2CppSetOption(Option.ArrayBoundsChecks, false)] diff --git a/src/Internal/ArrayUtility.cs b/src/Internal/ArrayUtility.cs index b1b8149..7d2f7ac 100644 --- a/src/Internal/ArrayUtility.cs +++ b/src/Internal/ArrayUtility.cs @@ -121,7 +121,6 @@ namespace DCFApixels.DragonECS.Core.Internal internal static class ArrayUtility { - //TODO потестить public static void ResizeOrCreate(ref T[] array, int newSize) { if (array == null) diff --git a/src/Internal/EcsTypeCodeManager.cs b/src/Internal/EcsTypeCodeManager.cs index 265115a..ea902a1 100644 --- a/src/Internal/EcsTypeCodeManager.cs +++ b/src/Internal/EcsTypeCodeManager.cs @@ -12,8 +12,6 @@ using Unity.IL2CPP.CompilerServices; namespace DCFApixels.DragonECS.Core.Internal { - //TODO разработать возможность ручного устанавливания ID типам. - //это может быть полезно как детерминированность для сети #if ENABLE_IL2CPP [Il2CppSetOption(Option.NullChecks, false)] [Il2CppSetOption(Option.ArrayBoundsChecks, false)] diff --git a/src/Pools/EcsPoolBase.cs b/src/Pools/EcsPoolBase.cs index a93b6c7..8d4d93a 100644 --- a/src/Pools/EcsPoolBase.cs +++ b/src/Pools/EcsPoolBase.cs @@ -81,7 +81,7 @@ namespace DCFApixels.DragonECS.Core.Internal public static readonly EcsNullPool instance = new EcsNullPool(); #region Properties - int IEcsReadonlyPool.ComponentTypeID { get { return 0; } }//TODO Првоерить что NullComponent всегда имеет id 0 + int IEcsReadonlyPool.ComponentTypeID { get { return 0; } } Type IEcsReadonlyPool.ComponentType { get { return typeof(NullComponent); } } EcsWorld IEcsReadonlyPool.World {