From 672e253b492f08dc1554ee8330963fb4a3cbcf10 Mon Sep 17 00:00:00 2001 From: Mikhail <99481254+DCFApixels@users.noreply.github.com> Date: Thu, 7 Mar 2024 03:30:18 +0800 Subject: [PATCH] rename GetPool to GetPoolInstance --- src/EcsAspect.cs | 6 +++--- src/EcsWorld.cs | 14 +++++++------- src/EcsWorld.pools.cs | 12 ++++++------ src/Pools/EcsPool.cs | 4 ++-- src/Pools/EcsTagPool.cs | 8 ++++---- src/entlong.cs | 4 ++-- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/EcsAspect.cs b/src/EcsAspect.cs index 4e013cd..587771f 100644 --- a/src/EcsAspect.cs +++ b/src/EcsAspect.cs @@ -106,19 +106,19 @@ namespace DCFApixels.DragonECS #region Include/Exclude/Optional/Combine public TPool Include() where TPool : IEcsPoolImplementation, new() { - var pool = _world.GetPool(); + var pool = _world.GetPoolInstance(); IncludeImplicit(pool.ComponentType); return pool; } public TPool Exclude() where TPool : IEcsPoolImplementation, new() { - var pool = _world.GetPool(); + var pool = _world.GetPoolInstance(); ExcludeImplicit(pool.ComponentType); return pool; } public TPool Optional() where TPool : IEcsPoolImplementation, new() { - return _world.GetPool(); + return _world.GetPoolInstance(); } private void IncludeImplicit(Type type) { diff --git a/src/EcsWorld.cs b/src/EcsWorld.cs index 3e1ebf2..5df4655 100644 --- a/src/EcsWorld.cs +++ b/src/EcsWorld.cs @@ -611,30 +611,30 @@ namespace DCFApixels.DragonECS #region Debug Components private static int[] _componentIDsBuffer = new int[64]; - public ReadOnlySpan GetComponentTypeIDs(int entityID) + public ReadOnlySpan GetComponentTypeIDsFor(int entityID) { - int count = GetComponentTypeIDs(entityID, ref _componentIDsBuffer); + int count = GetComponentTypeIDsFor(entityID, ref _componentIDsBuffer); return new ReadOnlySpan(_componentIDsBuffer, 0, count); } - public void GetComponents(int entityID, List list) + public void GetComponentsFor(int entityID, List list) { list.Clear(); - int count = GetComponentTypeIDs(entityID, ref _componentIDsBuffer); + int count = GetComponentTypeIDsFor(entityID, ref _componentIDsBuffer); for (int i = 0; i < count; i++) { list.Add(_pools[_componentIDsBuffer[i]].GetRaw(entityID)); } } - public void GetComponentTypes(int entityID, HashSet typeSet) + public void GetComponentTypesFor(int entityID, HashSet typeSet) { typeSet.Clear(); - int count = GetComponentTypeIDs(entityID, ref _componentIDsBuffer); + int count = GetComponentTypeIDsFor(entityID, ref _componentIDsBuffer); for (int i = 0; i < count; i++) { typeSet.Add(_pools[_componentIDsBuffer[i]].ComponentType); } } - private int GetComponentTypeIDs(int entityID, ref int[] componentIDs) + private int GetComponentTypeIDsFor(int entityID, ref int[] componentIDs) { int count = 0; var itemsCount = GetComponentsCount(entityID); diff --git a/src/EcsWorld.pools.cs b/src/EcsWorld.pools.cs index 387da8a..ee980cd 100644 --- a/src/EcsWorld.pools.cs +++ b/src/EcsWorld.pools.cs @@ -18,7 +18,7 @@ namespace DCFApixels.DragonECS private EcsNullPool _nullPool = EcsNullPool.instance; #region Getters - public IEcsPool GetPool(int componentTypeID) + public IEcsPool GetPoolInstance(int componentTypeID) { #if DEBUG if (_pools[componentTypeID].ComponentTypeID != componentTypeID) { Throw.UndefinedException(); } @@ -27,7 +27,7 @@ namespace DCFApixels.DragonECS } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public IEcsPool GetPool(Type componentType) + public IEcsPool GetPoolInstance(Type componentType) { int componentTypeID = GetComponentTypeID(componentType); ref var pool = ref _pools[componentTypeID]; @@ -42,7 +42,7 @@ namespace DCFApixels.DragonECS [UnityEngine.Scripting.Preserve] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public TPool GetPool() where TPool : IEcsPoolImplementation, new() + public TPool GetPoolInstance() where TPool : IEcsPoolImplementation, new() { return Get>().instance; } @@ -50,7 +50,7 @@ namespace DCFApixels.DragonECS [UnityEngine.Scripting.Preserve] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public TPool GetPoolUnchecked() where TPool : IEcsPoolImplementation, new() + public TPool GetPoolInstanceUnchecked() where TPool : IEcsPoolImplementation, new() { return GetUnchecked>().instance; } @@ -58,7 +58,7 @@ namespace DCFApixels.DragonECS [UnityEngine.Scripting.Preserve] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TPool GetPool(int worldID) where TPool : IEcsPoolImplementation, new() + public static TPool GetPoolInstance(int worldID) where TPool : IEcsPoolImplementation, new() { return Get>(worldID).instance; } @@ -66,7 +66,7 @@ namespace DCFApixels.DragonECS [UnityEngine.Scripting.Preserve] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TPool UncheckedGetPool(int worldID) where TPool : IEcsPoolImplementation, new() + public static TPool GetPoolInstanceUnchecked(int worldID) where TPool : IEcsPoolImplementation, new() { return GetUnchecked>(worldID).instance; } diff --git a/src/Pools/EcsPool.cs b/src/Pools/EcsPool.cs index 2683f56..ce9364b 100644 --- a/src/Pools/EcsPool.cs +++ b/src/Pools/EcsPool.cs @@ -258,12 +258,12 @@ namespace DCFApixels.DragonECS [MethodImpl(MethodImplOptions.AggressiveInlining)] public static EcsPool GetPool(this EcsWorld self) where TComponent : struct, IEcsComponent { - return self.GetPool>(); + return self.GetPoolInstance>(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static EcsPool GetPoolUnchecked(this EcsWorld self) where TComponent : struct, IEcsComponent { - return self.GetPoolUnchecked>(); + return self.GetPoolInstanceUnchecked>(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] diff --git a/src/Pools/EcsTagPool.cs b/src/Pools/EcsTagPool.cs index e954204..8ee7ac0 100644 --- a/src/Pools/EcsTagPool.cs +++ b/src/Pools/EcsTagPool.cs @@ -239,12 +239,12 @@ namespace DCFApixels.DragonECS [MethodImpl(MethodImplOptions.AggressiveInlining)] public static EcsTagPool GetPool(this EcsWorld self) where TTagComponent : struct, IEcsTagComponent { - return self.GetPool>(); + return self.GetPoolInstance>(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static EcsTagPool GetPoolUnchecked(this EcsWorld self) where TTagComponent : struct, IEcsTagComponent { - return self.GetPoolUnchecked>(); + return self.GetPoolInstanceUnchecked>(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -268,12 +268,12 @@ namespace DCFApixels.DragonECS [MethodImpl(MethodImplOptions.AggressiveInlining)] public static EcsTagPool GetTagPool(this EcsWorld self) where TTagComponent : struct, IEcsTagComponent { - return self.GetPool>(); + return self.GetPoolInstance>(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static EcsTagPool GetTagPoolUnchecked(this EcsWorld self) where TTagComponent : struct, IEcsTagComponent { - return self.GetPoolUnchecked>(); + return self.GetPoolInstanceUnchecked>(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] diff --git a/src/entlong.cs b/src/entlong.cs index 5b50180..73e2a32 100644 --- a/src/entlong.cs +++ b/src/entlong.cs @@ -231,7 +231,7 @@ namespace DCFApixels.DragonECS { get { - _value.World.GetComponents(_value.ID, _componentsList); + _value.World.GetComponentsFor(_value.ID, _componentsList); return _componentsList; } } @@ -322,7 +322,7 @@ namespace DCFApixels.DragonECS { get { - _value.World.GetComponents(_value.ID, _componentsList); + _value.World.GetComponentsFor(_value.ID, _componentsList); return _componentsList; } }