diff --git a/src/Builtin/Systems.cs b/src/Builtin/Systems.cs index 1d6bc1e..4e6e95c 100644 --- a/src/Builtin/Systems.cs +++ b/src/Builtin/Systems.cs @@ -53,7 +53,7 @@ namespace DCFApixels.DragonECS public static EcsPipeline.Builder AutoDel(this EcsPipeline.Builder b, string layerName = AUTO_DEL_LAYER) where TComponent : struct, IEcsComponent { - if(AUTO_DEL_LAYER == layerName) + if (AUTO_DEL_LAYER == layerName) b.Layers.Insert(EcsConsts.POST_END_LAYER, AUTO_DEL_LAYER); b.AddUnique(new DeleteOneFrameComponentSystem(), layerName); return b; diff --git a/src/Consts.cs b/src/Consts.cs index b21827b..41bfb71 100644 --- a/src/Consts.cs +++ b/src/Consts.cs @@ -4,7 +4,7 @@ { public const string FRAMEWORK_NAME = "DragonECS"; - public const string EXCEPTION_MESSAGE_PREFIX = "["+ FRAMEWORK_NAME + "] "; + public const string EXCEPTION_MESSAGE_PREFIX = "[" + FRAMEWORK_NAME + "] "; public const string DEBUG_PREFIX = "[DEBUG] "; public const string DEBUG_WARNING_TAG = "WARNING"; public const string DEBUG_ERROR_TAG = "ERROR"; diff --git a/src/Debug/Attributes/DebugColorAttribute.cs b/src/Debug/Attributes/DebugColorAttribute.cs index 378a02b..4e9ebb7 100644 --- a/src/Debug/Attributes/DebugColorAttribute.cs +++ b/src/Debug/Attributes/DebugColorAttribute.cs @@ -69,7 +69,7 @@ namespace DCFApixels.DragonECS BlueViolet = (138 << 24) + (43 << 16) + (226 << 8), /// Yellow. RGB is (255, 3, 62) AmericanRose = (255 << 24) + (3 << 16) + (62 << 8), - + /// Grey/Gray. RGB is (127, 127, 127) Gray = (127 << 24) + (127 << 16) + (127 << 8), /// Grey/Gray. RGB is (127, 127, 127) diff --git a/src/Debug/EcsDebug.cs b/src/Debug/EcsDebug.cs index a2f8d2a..70bdf50 100644 --- a/src/Debug/EcsDebug.cs +++ b/src/Debug/EcsDebug.cs @@ -117,7 +117,7 @@ namespace DCFApixels.DragonECS public int RegisterMark(string name) { int id; - if(!_nameIdTable.TryGetValue(name, out id)) + if (!_nameIdTable.TryGetValue(name, out id)) { id = _idDispenser.GetFree(); _nameIdTable.Add(name, id); @@ -149,7 +149,7 @@ namespace DCFApixels.DragonECS { #if !DISABLE_DRAGONECS_DEBUGGER _stopwatchs = new Stopwatch[64]; - _stopwatchsNames= new string[64]; + _stopwatchsNames = new string[64]; #endif } public override void Print(string tag, object v) diff --git a/src/EcsGroup.cs b/src/EcsGroup.cs index 2f0ee31..53b4c67 100644 --- a/src/EcsGroup.cs +++ b/src/EcsGroup.cs @@ -242,7 +242,7 @@ namespace DCFApixels.DragonECS #if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS if (group.World != _source) throw new ArgumentException("groupFilter.WorldIndex != WorldIndex"); #endif - if(_count > 0) + if (_count > 0) Clear(); foreach (var item in group) AddInternal(item); @@ -371,14 +371,14 @@ namespace DCFApixels.DragonECS #region Enumerator public ref struct Enumerator// : IDisposable { - // private readonly EcsGroup source; + // private readonly EcsGroup source; private readonly int[] _dense; private readonly int _count; private int _index; [MethodImpl(MethodImplOptions.AggressiveInlining)] public Enumerator(EcsGroup group) { - // source = group; + // source = group; _dense = group._dense; _count = group._count; _index = 0; @@ -389,7 +389,7 @@ namespace DCFApixels.DragonECS get => _dense[_index]; } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool MoveNext() => ++_index <= _count && _count<_dense.Length; // <= потму что отсчет начинается с индекса 1 //_count < _dense.Length дает среде понять что проверки на выход за границы не нужны + public bool MoveNext() => ++_index <= _count && _count < _dense.Length; // <= потму что отсчет начинается с индекса 1 //_count < _dense.Length дает среде понять что проверки на выход за границы не нужны //[MethodImpl(MethodImplOptions.AggressiveInlining)] //public void Dispose() => source.Unlock(); } @@ -410,7 +410,7 @@ namespace DCFApixels.DragonECS return false; return true; } - public override int GetHashCode() + public override int GetHashCode() { int hash = 0; foreach (var item in this) diff --git a/src/EcsPipeline.cs b/src/EcsPipeline.cs index e160021..52ee7db 100644 --- a/src/EcsPipeline.cs +++ b/src/EcsPipeline.cs @@ -194,7 +194,7 @@ namespace DCFApixels.DragonECS } foreach (var item in Layers) { - if(_systems.TryGetValue(item, out var list)) + if (_systems.TryGetValue(item, out var list)) result.AddRange(list); } return new EcsPipeline(result.ToArray()); @@ -211,7 +211,7 @@ namespace DCFApixels.DragonECS { _source = source; _layers = new List(16) { basicLayerName, ADD_LAYER }; - _basicLayerName = basicLayerName; + _basicLayerName = basicLayerName; } public Builder Add(string newLayer) => Insert(ADD_LAYER, newLayer); diff --git a/src/EcsRunner.cs b/src/EcsRunner.cs index b3b8b7f..9d634a4 100644 --- a/src/EcsRunner.cs +++ b/src/EcsRunner.cs @@ -122,7 +122,7 @@ namespace DCFApixels.DragonECS #if UNITY_2020_3_OR_NEWER [UnityEngine.Scripting.RequireDerived, UnityEngine.Scripting.Preserve] #endif - public abstract class EcsRunner : IEcsProcess, IEcsRunner + public abstract class EcsRunner : IEcsProcess, IEcsRunner where TInterface : IEcsProcess { #region Register diff --git a/src/EcsWorld.cs b/src/EcsWorld.cs index 60aa869..ef9ec9d 100644 --- a/src/EcsWorld.cs +++ b/src/EcsWorld.cs @@ -360,13 +360,13 @@ namespace DCFApixels.DragonECS { list.Clear(); var itemsCount = GetComponentsCount(entityID); - if (itemsCount == 0) + if (itemsCount == 0) return; for (var i = 0; i < _pools.Length; i++) { if (_pools[i].Has(entityID)) - list.Add(_pools[i].GetRaw(entityID)); + list.Add(_pools[i].GetRaw(entityID)); if (list.Count >= itemsCount) break; } diff --git a/src/Executors/EcsWhereExecutor.cs b/src/Executors/EcsWhereExecutor.cs index 4673825..37a614c 100644 --- a/src/Executors/EcsWhereExecutor.cs +++ b/src/Executors/EcsWhereExecutor.cs @@ -33,7 +33,7 @@ using (_executeWhere.Auto()) { #if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS - if (sourceGroup.IsNull) throw new System.ArgumentNullException();//TODO составить текст исключения. + if (sourceGroup.IsNull) throw new System.ArgumentNullException();//TODO составить текст исключения. #endif _subject.GetIteratorFor(sourceGroup).CopyTo(_filteredGroup); return new EcsWhereResult(this, _filteredGroup.Readonly); diff --git a/src/Pools/EcsPool.cs b/src/Pools/EcsPool.cs index bf3dfac..75cd0eb 100644 --- a/src/Pools/EcsPool.cs +++ b/src/Pools/EcsPool.cs @@ -36,7 +36,7 @@ namespace DCFApixels.DragonECS void IEcsPoolImplementation.OnInit(EcsWorld world, int componentID) { _source = world; - _id = componentID; + _id = componentID; const int capacity = 512; @@ -178,12 +178,12 @@ namespace DCFApixels.DragonECS #region Listeners public void AddListener(IEcsPoolEventListener listener) { - if(listener == null) { throw new ArgumentNullException("listener is null"); } + if (listener == null) { throw new ArgumentNullException("listener is null"); } _listeners.Add(listener); } public void RemoveListener(IEcsPoolEventListener listener) { - if(listener == null) { throw new ArgumentNullException("listener is null"); } + if (listener == null) { throw new ArgumentNullException("listener is null"); } _listeners.Remove(listener); } #endregion