diff --git a/src/Builtin/BaseRunners.cs b/src/Builtin/BaseRunners.cs index b01b49d..42f2a57 100644 --- a/src/Builtin/BaseRunners.cs +++ b/src/Builtin/BaseRunners.cs @@ -18,7 +18,6 @@ namespace DCFApixels.DragonECS { public void Destroy(EcsPipeline pipeline); } - public interface IEcsBaseSystem : IEcsInitSystem, IEcsRunSystem, IEcsDestroySystem { } namespace Internal @@ -32,10 +31,10 @@ namespace DCFApixels.DragonECS public void PreInit(EcsPipeline pipeline) { #if DEBUG && !DISABLE_DEBUG - for (int i = 0; i < targets.Length && targets.Length <= _markers.Length; i++) + for (int i = 0; i < Targets.Length && Targets.Length <= _markers.Length; i++) { using (_markers[i].Auto()) - targets[i].PreInit(pipeline); + Targets[i].PreInit(pipeline); } #else foreach (var item in targets) item.PreInit(pipeline); @@ -45,10 +44,10 @@ namespace DCFApixels.DragonECS #if DEBUG && !DISABLE_DEBUG protected override void OnSetup() { - _markers = new EcsProfilerMarker[targets.Length]; - for (int i = 0; i < targets.Length; i++) + _markers = new EcsProfilerMarker[Targets.Length]; + for (int i = 0; i < Targets.Length; i++) { - _markers[i] = new EcsProfilerMarker(EcsDebug.RegisterMark($"EcsRunner.{targets[i].GetType().Name}.{nameof(PreInit)}")); + _markers[i] = new EcsProfilerMarker(EcsDebug.RegisterMark($"EcsRunner.{Targets[i].GetType().Name}.{nameof(PreInit)}")); } } #endif @@ -62,10 +61,10 @@ namespace DCFApixels.DragonECS public void Init(EcsPipeline pipeline) { #if DEBUG && !DISABLE_DEBUG - for (int i = 0; i < targets.Length && targets.Length <= _markers.Length; i++) + for (int i = 0; i < Targets.Length && Targets.Length <= _markers.Length; i++) { using (_markers[i].Auto()) - targets[i].Init(pipeline); + Targets[i].Init(pipeline); } #else foreach (var item in targets) item.Init(pipeline); @@ -75,10 +74,10 @@ namespace DCFApixels.DragonECS #if DEBUG && !DISABLE_DEBUG protected override void OnSetup() { - _markers = new EcsProfilerMarker[targets.Length]; - for (int i = 0; i < targets.Length; i++) + _markers = new EcsProfilerMarker[Targets.Length]; + for (int i = 0; i < Targets.Length; i++) { - _markers[i] = new EcsProfilerMarker(EcsDebug.RegisterMark($"EcsRunner.{targets[i].GetType().Name}.{nameof(Init)}")); + _markers[i] = new EcsProfilerMarker(EcsDebug.RegisterMark($"EcsRunner.{Targets[i].GetType().Name}.{nameof(Init)}")); } } #endif @@ -92,10 +91,10 @@ namespace DCFApixels.DragonECS public void Run(EcsPipeline pipeline) { #if DEBUG && !DISABLE_DEBUG - for (int i = 0; i < targets.Length && targets.Length <= _markers.Length; i++) + for (int i = 0; i < Targets.Length && Targets.Length <= _markers.Length; i++) { using (_markers[i].Auto()) - targets[i].Run(pipeline); + Targets[i].Run(pipeline); } #else @@ -106,10 +105,10 @@ namespace DCFApixels.DragonECS #if DEBUG && !DISABLE_DEBUG protected override void OnSetup() { - _markers = new EcsProfilerMarker[targets.Length]; - for (int i = 0; i < targets.Length; i++) + _markers = new EcsProfilerMarker[Targets.Length]; + for (int i = 0; i < Targets.Length; i++) { - _markers[i] = new EcsProfilerMarker(EcsDebug.RegisterMark($"EcsRunner.{targets[i].GetType().Name}.{nameof(Run)}")); + _markers[i] = new EcsProfilerMarker(EcsDebug.RegisterMark($"EcsRunner.{Targets[i].GetType().Name}.{nameof(Run)}")); } } #endif @@ -123,10 +122,10 @@ namespace DCFApixels.DragonECS public void Destroy(EcsPipeline pipeline) { #if DEBUG && !DISABLE_DEBUG - for (int i = 0; i < targets.Length && targets.Length <= _markers.Length; i++) + for (int i = 0; i < Targets.Length && Targets.Length <= _markers.Length; i++) { using (_markers[i].Auto()) - targets[i].Destroy(pipeline); + Targets[i].Destroy(pipeline); } #else foreach (var item in targets) item.Destroy(pipeline); @@ -136,10 +135,10 @@ namespace DCFApixels.DragonECS #if DEBUG && !DISABLE_DEBUG protected override void OnSetup() { - _markers = new EcsProfilerMarker[targets.Length]; - for (int i = 0; i < targets.Length; i++) + _markers = new EcsProfilerMarker[Targets.Length]; + for (int i = 0; i < Targets.Length; i++) { - _markers[i] = new EcsProfilerMarker(EcsDebug.RegisterMark($"EcsRunner.{targets[i].GetType().Name}.{nameof(Destroy)}")); + _markers[i] = new EcsProfilerMarker(EcsDebug.RegisterMark($"EcsRunner.{Targets[i].GetType().Name}.{nameof(Destroy)}")); } } #endif diff --git a/src/Builtin/InjectSystem.cs b/src/Builtin/InjectSystem.cs index b547f58..3ecd21b 100644 --- a/src/Builtin/InjectSystem.cs +++ b/src/Builtin/InjectSystem.cs @@ -11,22 +11,18 @@ namespace DCFApixels.DragonECS private EcsPipeline _source; private InjectSystemBase[] _injectSystems; private int _injectCount; - public PreInitInjectController(EcsPipeline source) { _injectCount = 0; _source = source; _injectSystems = _source.AllSystems.OfType().ToArray(); } - public bool OnInject() { _injectCount++; return IsInjectionEnd; } - public bool IsInjectionEnd => _injectCount >= _injectSystems.Length; - public void Destroy() { _source = null; @@ -68,7 +64,6 @@ namespace DCFApixels.DragonECS _preInjectchache.PreInject(obj); foreach (var item in targets) item.Inject(obj); } - protected override void OnSetup() { _preInjectchache = Source.GetRunner(); diff --git a/src/EcsGroup.cs b/src/EcsGroup.cs index 6411181..695dd9d 100644 --- a/src/EcsGroup.cs +++ b/src/EcsGroup.cs @@ -2,7 +2,6 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Unity.Profiling; -using UnityEngine; using delayedOp = System.Int32; namespace DCFApixels.DragonECS @@ -11,6 +10,7 @@ namespace DCFApixels.DragonECS public readonly ref struct EcsReadonlyGroup { private readonly EcsGroup _source; + #region Constructors [MethodImpl(MethodImplOptions.AggressiveInlining)] public EcsReadonlyGroup(EcsGroup source) => _source = source; diff --git a/src/EcsWorld.cs b/src/EcsWorld.cs index 38121ce..ffaf4eb 100644 --- a/src/EcsWorld.cs +++ b/src/EcsWorld.cs @@ -41,6 +41,7 @@ namespace DCFApixels.DragonECS //буфер удаления откладывает освобождение андишников сущьностей. //Нужен для того чтобы запускать некоторые процесыы связанные с удалением сущьности не по одному при каждом удалении, а пачкой + //В теории такой подход частично улучшает ситуацию с переполнением поколений private int[] _delEntBuffer; private int _delEntBufferCount; diff --git a/src/Interfaces/IEcsTable.cs b/src/Interfaces/IEcsTable.cs index 3b5f1ef..2062dae 100644 --- a/src/Interfaces/IEcsTable.cs +++ b/src/Interfaces/IEcsTable.cs @@ -1,5 +1,4 @@ using System; -using System.Runtime.CompilerServices; namespace DCFApixels.DragonECS { diff --git a/src/Pools/EcsPool.cs b/src/Pools/EcsPool.cs index fe7c7b4..3b7d24a 100644 --- a/src/Pools/EcsPool.cs +++ b/src/Pools/EcsPool.cs @@ -1,7 +1,6 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Diagnostics; using System.Runtime.CompilerServices; using Unity.Profiling; diff --git a/src/Pools/EcsRelationPool.cs b/src/Pools/EcsRelationPool.cs index 9d6e265..c5a5c9c 100644 --- a/src/Pools/EcsRelationPool.cs +++ b/src/Pools/EcsRelationPool.cs @@ -1,5 +1,4 @@ using System; -using System.Diagnostics; using System.Runtime.CompilerServices; using Unity.Profiling; diff --git a/src/Utils/ArrayUtility.cs b/src/Utils/ArrayUtility.cs index 3b26372..2f55154 100644 --- a/src/Utils/ArrayUtility.cs +++ b/src/Utils/ArrayUtility.cs @@ -1,5 +1,5 @@ -using System.Runtime.InteropServices; -using System; +using System; +using System.Runtime.InteropServices; namespace DCFApixels.DragonECS { diff --git a/src/Utils/ITabelRecord.cs b/src/Utils/ITabelRecord.cs deleted file mode 100644 index d2f9b15..0000000 --- a/src/Utils/ITabelRecord.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace DCFApixels.DragonECS -{ - public interface ITabelRecord - { - //TODO rename to index; Так EcsEntity по определению станет идентификатором - public int Id { get; } - } -}