From b1192d32d988ba63c9fc6be1c0f3ae4756437359 Mon Sep 17 00:00:00 2001 From: Mikhail <99481254+DCFApixels@users.noreply.github.com> Date: Sun, 15 Mar 2026 20:20:24 +0800 Subject: [PATCH] fxi tag pool checks/add ThrowNullComponent/add EcsRefPool to readme --- README-RU.md | 1 + src/Pools/EcsPoolBase.cs | 7 ++++++- src/Pools/EcsTagPool.cs | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README-RU.md b/README-RU.md index b443b71..7a063b6 100644 --- a/README-RU.md +++ b/README-RU.md @@ -125,6 +125,7 @@ https://github.com/DCFApixels/DragonECS.git * [Графы](https://github.com/DCFApixels/DragonECS-Graphs) * Утилиты: * [Упрощенный синтаксис](https://gist.github.com/DCFApixels/d7bfbfb8cb70d141deff00be24f28ff0) + * [EcsRefPool](https://gist.github.com/DCFApixels/73e392ccabdd98b3d4a517017d8a3f22) * [Таймеры](https://gist.github.com/DCFApixels/71a416275660c465ece76242290400df) * [Однокадровые компоненты](https://gist.github.com/DCFApixels/46d512dbcf96c115b94c3af502461f60) * [Шаблоны кода IDE](https://gist.github.com/ctzcs/0ba948b0e53aa41fe1c87796a401660b) и [для Unity](https://gist.github.com/ctzcs/d4c7730cf6cd984fe6f9e0e3f108a0f1) diff --git a/src/Pools/EcsPoolBase.cs b/src/Pools/EcsPoolBase.cs index d7423e6..b91b462 100644 --- a/src/Pools/EcsPoolBase.cs +++ b/src/Pools/EcsPoolBase.cs @@ -62,7 +62,12 @@ namespace DCFApixels.DragonECS.PoolsCore [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowNullListener() { - throw new ArgumentNullException("listener is null"); + throw new ArgumentNullException("Listener is null"); + } + [MethodImpl(MethodImplOptions.NoInlining)] + public static void ThrowNullComponent() + { + throw new ArgumentNullException("Component is null"); } [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowPoolLocked() diff --git a/src/Pools/EcsTagPool.cs b/src/Pools/EcsTagPool.cs index 74342b2..07e5713 100644 --- a/src/Pools/EcsTagPool.cs +++ b/src/Pools/EcsTagPool.cs @@ -116,6 +116,7 @@ namespace DCFApixels.DragonECS public void Add(int entityID) { #if DEBUG + if (entityID == EcsConsts.NULL_ENTITY_ID) { EcsPoolThrowHelper.ThrowEntityIsNotAlive(_world, entityID); } if (_world.IsUsed(entityID) == false) { EcsPoolThrowHelper.ThrowEntityIsNotAlive(_world, entityID); } if (Has(entityID)) { EcsPoolThrowHelper.ThrowAlreadyHasComponent(entityID); } if (_isLocked) { EcsPoolThrowHelper.ThrowPoolLocked(); } @@ -144,6 +145,7 @@ namespace DCFApixels.DragonECS public void Del(int entityID) { #if DEBUG + if (entityID == EcsConsts.NULL_ENTITY_ID) { EcsPoolThrowHelper.ThrowEntityIsNotAlive(_world, entityID); } if (!Has(entityID)) { EcsPoolThrowHelper.ThrowNotHaveComponent(entityID); } if (_isLocked) { EcsPoolThrowHelper.ThrowPoolLocked(); } #elif DRAGONECS_STABILITY_MODE