From 4e54be72bf1b45c3a067186f29c9050a5bbeee49 Mon Sep 17 00:00:00 2001 From: Mikhail <99481254+DCFApixels@users.noreply.github.com> Date: Tue, 5 Nov 2024 15:56:46 +0800 Subject: [PATCH] fix naming --- src/Pools/EcsPool.cs | 24 ++++++++++++------------ src/Pools/EcsPoolBase.cs | 2 +- src/Pools/EcsTagPool.cs | 26 +++++++++++++------------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/Pools/EcsPool.cs b/src/Pools/EcsPool.cs index 598b8c2..c043842 100644 --- a/src/Pools/EcsPool.cs +++ b/src/Pools/EcsPool.cs @@ -83,8 +83,8 @@ namespace DCFApixels.DragonECS { ref int itemIndex = ref _mapping[entityID]; #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS - if (itemIndex > 0) { EcsPoolThrowHalper.ThrowAlreadyHasComponent(entityID); } - if (_isLocked) { EcsPoolThrowHalper.ThrowPoolLocked(); } + if (itemIndex > 0) { EcsPoolThrowHelper.ThrowAlreadyHasComponent(entityID); } + if (_isLocked) { EcsPoolThrowHelper.ThrowPoolLocked(); } #endif if (_recycledItemsCount > 0) { @@ -110,7 +110,7 @@ namespace DCFApixels.DragonECS public ref T Get(int entityID) { #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS - if (!Has(entityID)) { EcsPoolThrowHalper.ThrowNotHaveComponent(entityID); } + if (!Has(entityID)) { EcsPoolThrowHelper.ThrowNotHaveComponent(entityID); } #endif #if !DISABLE_POOLS_EVENTS _listeners.InvokeOnGet(entityID, _listenersCachedCount); @@ -121,7 +121,7 @@ namespace DCFApixels.DragonECS public ref readonly T Read(int entityID) { #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS - if (!Has(entityID)) { EcsPoolThrowHalper.ThrowNotHaveComponent(entityID); } + if (!Has(entityID)) { EcsPoolThrowHelper.ThrowNotHaveComponent(entityID); } #endif return ref _items[_mapping[entityID]]; } @@ -131,7 +131,7 @@ namespace DCFApixels.DragonECS if (itemIndex <= 0) { //Add block #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS - if (_isLocked) { EcsPoolThrowHalper.ThrowPoolLocked(); } + if (_isLocked) { EcsPoolThrowHelper.ThrowPoolLocked(); } #endif if (_recycledItemsCount > 0) { @@ -165,11 +165,11 @@ namespace DCFApixels.DragonECS public void Del(int entityID) { #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS - if (_isLocked) { EcsPoolThrowHalper.ThrowPoolLocked(); } + if (_isLocked) { EcsPoolThrowHelper.ThrowPoolLocked(); } #endif ref int itemIndex = ref _mapping[entityID]; #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS - if (itemIndex <= 0) { EcsPoolThrowHalper.ThrowNotHaveComponent(entityID); } + if (itemIndex <= 0) { EcsPoolThrowHelper.ThrowNotHaveComponent(entityID); } #endif DisableComponent(ref _items[itemIndex]); if (_recycledItemsCount >= _recycledItems.Length) @@ -194,14 +194,14 @@ namespace DCFApixels.DragonECS public void Copy(int fromEntityID, int toEntityID) { #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS - if (!Has(fromEntityID)) { EcsPoolThrowHalper.ThrowNotHaveComponent(fromEntityID); } + if (!Has(fromEntityID)) { EcsPoolThrowHelper.ThrowNotHaveComponent(fromEntityID); } #endif CopyComponent(ref Get(fromEntityID), ref TryAddOrGet(toEntityID)); } public void Copy(int fromEntityID, EcsWorld toWorld, int toEntityID) { #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS - if (!Has(fromEntityID)) { EcsPoolThrowHalper.ThrowNotHaveComponent(fromEntityID); } + if (!Has(fromEntityID)) { EcsPoolThrowHelper.ThrowNotHaveComponent(fromEntityID); } #endif CopyComponent(ref Get(fromEntityID), ref toWorld.GetPool().TryAddOrGet(toEntityID)); } @@ -209,7 +209,7 @@ namespace DCFApixels.DragonECS public void ClearAll() { #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS - if (_isLocked) { EcsPoolThrowHalper.ThrowPoolLocked(); } + if (_isLocked) { EcsPoolThrowHelper.ThrowPoolLocked(); } #endif var span = _source.Where(out SingleAspect> _); _itemsCount = 0; @@ -274,13 +274,13 @@ namespace DCFApixels.DragonECS #if !DISABLE_POOLS_EVENTS public void AddListener(IEcsPoolEventListener listener) { - if (listener == null) { EcsPoolThrowHalper.ThrowNullListener(); } + if (listener == null) { EcsPoolThrowHelper.ThrowNullListener(); } _listeners.Add(listener); _listenersCachedCount++; } public void RemoveListener(IEcsPoolEventListener listener) { - if (listener == null) { EcsPoolThrowHalper.ThrowNullListener(); } + if (listener == null) { EcsPoolThrowHelper.ThrowNullListener(); } if (_listeners.Remove(listener)) { _listenersCachedCount--; diff --git a/src/Pools/EcsPoolBase.cs b/src/Pools/EcsPoolBase.cs index f2ac2dc..6f6f713 100644 --- a/src/Pools/EcsPoolBase.cs +++ b/src/Pools/EcsPoolBase.cs @@ -22,7 +22,7 @@ namespace DCFApixels.DragonECS.PoolsCore /// Component type public interface IEcsPoolImplementation : IEcsPoolImplementation { } - public static class EcsPoolThrowHalper + public static class EcsPoolThrowHelper { public static void ThrowAlreadyHasComponent(int entityID) { diff --git a/src/Pools/EcsTagPool.cs b/src/Pools/EcsTagPool.cs index 6c11a48..8893ca8 100644 --- a/src/Pools/EcsTagPool.cs +++ b/src/Pools/EcsTagPool.cs @@ -92,8 +92,8 @@ namespace DCFApixels.DragonECS public void Add(int entityID) { #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS - if (Has(entityID)) { EcsPoolThrowHalper.ThrowAlreadyHasComponent(entityID); } - if (_isLocked) { EcsPoolThrowHalper.ThrowPoolLocked(); } + if (Has(entityID)) { EcsPoolThrowHelper.ThrowAlreadyHasComponent(entityID); } + if (_isLocked) { EcsPoolThrowHelper.ThrowPoolLocked(); } #endif _count++; _mapping[entityID] = true; @@ -117,8 +117,8 @@ namespace DCFApixels.DragonECS public void Del(int entityID) { #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS - if (!Has(entityID)) { EcsPoolThrowHalper.ThrowNotHaveComponent(entityID); } - if (_isLocked) { EcsPoolThrowHalper.ThrowPoolLocked(); } + if (!Has(entityID)) { EcsPoolThrowHelper.ThrowNotHaveComponent(entityID); } + if (_isLocked) { EcsPoolThrowHelper.ThrowPoolLocked(); } #endif _mapping[entityID] = false; _count--; @@ -138,14 +138,14 @@ namespace DCFApixels.DragonECS public void Copy(int fromEntityID, int toEntityID) { #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS - if (!Has(fromEntityID)) { EcsPoolThrowHalper.ThrowNotHaveComponent(fromEntityID); } + if (!Has(fromEntityID)) { EcsPoolThrowHelper.ThrowNotHaveComponent(fromEntityID); } #endif TryAdd(toEntityID); } public void Copy(int fromEntityID, EcsWorld toWorld, int toEntityID) { #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS - if (!Has(fromEntityID)) { EcsPoolThrowHalper.ThrowNotHaveComponent(fromEntityID); } + if (!Has(fromEntityID)) { EcsPoolThrowHelper.ThrowNotHaveComponent(fromEntityID); } #endif toWorld.GetPool().TryAdd(toEntityID); } @@ -178,7 +178,7 @@ namespace DCFApixels.DragonECS public void ClearAll() { #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS - if (_isLocked) { EcsPoolThrowHalper.ThrowPoolLocked(); } + if (_isLocked) { EcsPoolThrowHelper.ThrowPoolLocked(); } #endif var span = _source.Where(out SingleAspect> _); _count = 0; @@ -228,14 +228,14 @@ namespace DCFApixels.DragonECS object IEcsReadonlyPool.GetRaw(int entityID) { #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS - if (Has(entityID) == false) { EcsPoolThrowHalper.ThrowNotHaveComponent(entityID); } + if (Has(entityID) == false) { EcsPoolThrowHelper.ThrowNotHaveComponent(entityID); } #endif return _fakeComponent; } void IEcsPool.SetRaw(int entityID, object dataRaw) { #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS - if (Has(entityID) == false) { EcsPoolThrowHalper.ThrowNotHaveComponent(entityID); } + if (Has(entityID) == false) { EcsPoolThrowHelper.ThrowNotHaveComponent(entityID); } #endif } ref T IEcsStructPool.Add(int entityID) @@ -246,14 +246,14 @@ namespace DCFApixels.DragonECS ref readonly T IEcsStructPool.Read(int entityID) { #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS - if (Has(entityID) == false) { EcsPoolThrowHalper.ThrowNotHaveComponent(entityID); } + if (Has(entityID) == false) { EcsPoolThrowHelper.ThrowNotHaveComponent(entityID); } #endif return ref _fakeComponent; } ref T IEcsStructPool.Get(int entityID) { #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS - if (Has(entityID) == false) { EcsPoolThrowHalper.ThrowNotHaveComponent(entityID); } + if (Has(entityID) == false) { EcsPoolThrowHelper.ThrowNotHaveComponent(entityID); } #endif return ref _fakeComponent; } @@ -263,13 +263,13 @@ namespace DCFApixels.DragonECS #if !DISABLE_POOLS_EVENTS public void AddListener(IEcsPoolEventListener listener) { - if (listener == null) { EcsPoolThrowHalper.ThrowNullListener(); } + if (listener == null) { EcsPoolThrowHelper.ThrowNullListener(); } _listeners.Add(listener); _listenersCachedCount++; } public void RemoveListener(IEcsPoolEventListener listener) { - if (listener == null) { EcsPoolThrowHalper.ThrowNullListener(); } + if (listener == null) { EcsPoolThrowHelper.ThrowNullListener(); } if (_listeners.Remove(listener)) { _listenersCachedCount--;